Thread: Macro errors
View Single Post
 
Old 09-14-2012, 04:09 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

Hi
Not conversant with VB and so need further clarifcation
These are three separate Macros
When I copy the details you sent to create one of the macros should it appear as I have done it and repeat for each separate macro with each starting Call OpenDoc followed by path etc
Code:
Sub DCOUPE22()
'
' DCOUPE22 Macro
'
'Call OpenDoc("E:\DOCUMENTS\COUPE\D_C.dotm")
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:=""
End Sub
When I try to run this I get message after first EndSub
Compile error
Ambiguous name detected: Open Doc

Can you help further please

Last edited by macropod; 09-14-2012 at 04:13 AM. Reason: Added code tags & formatting
Reply With Quote