Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Word, I get: wdGoToBookmark-not defined??? 1

Status
Not open for further replies.

bobleonard

Programmer
Mar 28, 2002
32
US

Hi,

The complete code is:


Set wordobj = CreateObject("Word.Application")
'wordobj.ChangeFileOpenDirectory = "C:\Aword\"
wordobj.Visible = True
wordobj.Documents.Add Template:="C:\Aword\awordtemplate.dotm", NewTemplate:=False


Selection.Goto What:=wdGoToBookmark, Name:="Pnumber"
Selection.Typetext CStr(Me![ID])

I can step through the code until I hit the Selection.goto line?? Then I get the error: Variable not defined and the expression: wdGoToBookmark—highlighted??
Seems strange to me…I would have thought this to be a reserve word or something like that.

thanks,bob
 
Set wordobj = CreateObject("Word.Application")
'wordobj.ChangeFileOpenDirectory = "C:\Aword\"
wordobj.Visible = True
wordobj.Documents.Add Template:="C:\Aword\awordtemplate.dotm", NewTemplate:=False
wordobj.Selection.Goto What:=-1, Name:="Pnumber"
wordobj.Selection.Typetext CStr(Me![ID])


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top