Hi there, friend of mine created a Word Macro (97) which was supposed to send the active document to a certain address (coding as below) -
Sub Send()
'------------------------------------------------------------------------
'DIM SOME VARIBLES TO HOLD
'
'-------------------------------------------------------------------------
Dim strDocName As String
Dim Message, Title, Default, MyValue
Dim strDefaultAddress As String
' Get the current documents name
strDocName = "ActiveDocument.Name"
' Set the default userid to send to
strDefaultAddress = "bfhsc7tsm"
' get a input box to display the default address, or the user can
' enter a different one.
Message = "Enter a users login name" ' Set prompt.
Title = "Defualt Address" ' Set title.
Default = strDefaultAddress
MyValue = InputBox(Message, Title, Default)
' Send the document
Document("" & strDocName & ""
.HasRoutingSlip = True
With Documents("" & strDocName & ""
.RoutingSlip
.Subject = "Status Doc "
.AddRecipient Recipient:="" & MyValue & ""
.Delivery = wdAllAtOnce
End With
Documents("" & strDocName & ""
.Route
End Sub
- and when I run it Word keeps crashing with a Dr Watson error.
When I choose Debug/Compile Project I get a 'Compile Error Message' which states 'Sub or Function not defined' where I have underlined. My mate reckons this runs OK his end so has anyone got any ideas please.
Thanks.
Molenski
p.s. Please keep answers easy as I am a complete newbie!!!!
Sub Send()
'------------------------------------------------------------------------
'DIM SOME VARIBLES TO HOLD
'
'-------------------------------------------------------------------------
Dim strDocName As String
Dim Message, Title, Default, MyValue
Dim strDefaultAddress As String
' Get the current documents name
strDocName = "ActiveDocument.Name"
' Set the default userid to send to
strDefaultAddress = "bfhsc7tsm"
' get a input box to display the default address, or the user can
' enter a different one.
Message = "Enter a users login name" ' Set prompt.
Title = "Defualt Address" ' Set title.
Default = strDefaultAddress
MyValue = InputBox(Message, Title, Default)
' Send the document
Document("" & strDocName & ""
With Documents("" & strDocName & ""
.Subject = "Status Doc "
.AddRecipient Recipient:="" & MyValue & ""
.Delivery = wdAllAtOnce
End With
Documents("" & strDocName & ""
End Sub
- and when I run it Word keeps crashing with a Dr Watson error.
When I choose Debug/Compile Project I get a 'Compile Error Message' which states 'Sub or Function not defined' where I have underlined. My mate reckons this runs OK his end so has anyone got any ideas please.
Thanks.
Molenski
p.s. Please keep answers easy as I am a complete newbie!!!!