Code conversion from Wordbasic

J

John

Hi,

Can anyone suggest why the first line works fine and the second ones fails
to find the bookmark?

WordBasic.WW7_EditGoTo "bmOrdPresent"

Selection.GoTo what:=Bookmarks, Name:="bmOrdPresent"

Thanks,

John
 
J

Jezebel

Because "Bookmarks" is not a defined constant in VBA. One of the benefits of
VBA is that you can put the cursor on any keyword (such as GoTo) and press
F1 to see the Help for that keyword. Which would show you that you want --

What:=wdGoToBookmark.
 
J

John

Thanks. Explanation very helpful.

John

Jezebel said:
Because "Bookmarks" is not a defined constant in VBA. One of the benefits
of VBA is that you can put the cursor on any keyword (such as GoTo) and
press F1 to see the Help for that keyword. Which would show you that you
want --

What:=wdGoToBookmark.
 
Top