Thread: Macro errors
View Single Post
 
Old 09-25-2012, 03:41 AM
muster36 muster36 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Aug 2011
Posts: 23
muster36 is on a distinguished road
Default

I try to run the macro by View/Macro/ViewMacros/highlighting the macro 'MMM' and /Run. I then get the error message. Closing that error window I then press Debug and nothing happens. No highlighting and there is no list of Projects. but the error Macro is as follows

Code:
Sub MMM()
'
' MMM Macro
'
'Call OpenDoc("E:\DOCUMENTS\MMM\LETTER.doc")
Selection.MoveDown Unit:=wdLine, Count:=6

End Sub


Sub OpenDoc(StrDoc As String)
Documents.Open FileName:="StrDoc", ConfirmConversions:=False, ReadOnly:= _
  False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
  "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
  Format:=wdOpenFormatAuto, XMLTransform:=""
I shall re copy this outside the code brackets and so it should show just as text if that makes any difference


Sub MMM()
'
' MMM Macro
'
'Call OpenDoc("E:\DOCUMENTS\MMM\LETTER.doc")
Selection.MoveDown Unit:=wdLine, Count:=6

End Sub



Sub OpenDoc(StrDoc As String)
Documents.Open FileName:="StrDoc", ConfirmConversions:=False, ReadOnly:= _
False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto, XMLTransform:=""
Reply With Quote