Home > Software engineering >  New module, want to pass the rubik's magic, at the bookmark template insert wording, hello, but
New module, want to pass the rubik's magic, at the bookmark template insert wording, hello, but

Time:09-19

Public Sub CreateWord ()
Dim myword As Word. Application
Dim mydoc As New Word. The Document
The Set myword=New Word. Application
The Set mydoc=. The Documents. The Add (Template:="D: \ special case to present himself. \ dotx", Visible:=True)
Mydoc. Sections. GoTo I:=wdGoToBookmark, Which:=wdGoToAbsolute, Name:="accomplices who 1
"Mydoc. Sections. TypeText (Text:="Hello")
End Sub

New module, want to pass the rubik's magic, at the bookmark template insert wording, hello, but why prompt invalid illegal references,

CodePudding user response:

 mydoc. Sections. TypeText (Text:="Hello") 

Remove the parentheses to
 mydoc. Sections. TypeText Text:="Hello" 

Have a try
  •  Tags:  
  • VBA