S
shawneedsm
I have the following code that I am trying to use. The debugger stops at the
..subject line:
*********************
Private Sub SendTo_Click()
Dim Msg, Style, Title, Response
Dim Subject, AddRecipient, Delivery As Object
Msg = "Request has been forwarded!"
Style = vbOKOnly
Title = "Routing Confirmation"
' disable CommandButton
SendTo.Enabled = False
' Route the workbook
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Report Leak"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
ActiveDocument.Route
' Message box gives confirmation that document was routed
Response = MsgBox(Msg, Style, Title)
' Enable CommandButton
SendTo.Enabled = True
' close the workbook without saving changes
ActiveDocument.Close (wdDoNotSaveChanges)
End Sub
*************
I always get the following errors:
first one window with "General mail failure. Close Microsoft Office Word,
restart the mail system, and try again." and a second window after that with
"Run time error '91': object variable or with block variable not set."
What am I doing wrong?
..subject line:
*********************
Private Sub SendTo_Click()
Dim Msg, Style, Title, Response
Dim Subject, AddRecipient, Delivery As Object
Msg = "Request has been forwarded!"
Style = vbOKOnly
Title = "Routing Confirmation"
' disable CommandButton
SendTo.Enabled = False
' Route the workbook
ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Report Leak"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
ActiveDocument.Route
' Message box gives confirmation that document was routed
Response = MsgBox(Msg, Style, Title)
' Enable CommandButton
SendTo.Enabled = True
' close the workbook without saving changes
ActiveDocument.Close (wdDoNotSaveChanges)
End Sub
*************
I always get the following errors:
first one window with "General mail failure. Close Microsoft Office Word,
restart the mail system, and try again." and a second window after that with
"Run time error '91': object variable or with block variable not set."
What am I doing wrong?