K
Kurt Heisler
This question has been asked many times, but I can’t seem to find a
solution that works. Not sure what I’m doing wrong.
I would like to add a “Submit” button on a protected Word 2003
document, so when the user clicks on it his Outlook 2003 opens and
sends the document to me as an attachment. I tried to do this but when
I click on the button, the button depresses but nothing else happens
(the code doesn’t run). Also, if I close the document and reopen it,
it’s still protected but is back in Design View (even though the
Design View button on the Control Toolbox is grayed out).
Consequently, the button doesn’t work, and the user can access its
properties and VB code.
Here's what I did. I'm obviously overlooking something:
1. Unprotect form.
2. Add command button (using the Command Button on the Control
Toolbox)
3. Add the code to the command button (double click on Command Button,
add code in VB window)
4. Save and close the VB window
5. Exit out of Design mode (click the Design Mode button on the
Control Toolbox)
6. Protect and Save form.
I suspect the problem has nothing to do with the VB code ("Hello
world" probably wouldn't even work) and everything to do with how I’m
adding the command button. But, here is the code I’m using:
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Subject line goes here"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
ActiveDocument.Route
solution that works. Not sure what I’m doing wrong.
I would like to add a “Submit” button on a protected Word 2003
document, so when the user clicks on it his Outlook 2003 opens and
sends the document to me as an attachment. I tried to do this but when
I click on the button, the button depresses but nothing else happens
(the code doesn’t run). Also, if I close the document and reopen it,
it’s still protected but is back in Design View (even though the
Design View button on the Control Toolbox is grayed out).
Consequently, the button doesn’t work, and the user can access its
properties and VB code.
Here's what I did. I'm obviously overlooking something:
1. Unprotect form.
2. Add command button (using the Command Button on the Control
Toolbox)
3. Add the code to the command button (double click on Command Button,
add code in VB window)
4. Save and close the VB window
5. Exit out of Design mode (click the Design Mode button on the
Control Toolbox)
6. Protect and Save form.
I suspect the problem has nothing to do with the VB code ("Hello
world" probably wouldn't even work) and everything to do with how I’m
adding the command button. But, here is the code I’m using:
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Subject line goes here"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
ActiveDocument.Route