Forms using Bookmarks

J

Johnnyboy5

I am learning to make a user form.

how can i see the bookmarks I have put in the document at the same
time as entering the codes in the "View code" just to make sure i am
putting the right names against the right boxes etc.

Also is there a short cut to the View Code screen.


Johnnyboy
 
S

Suzanne S. Barnhill

If you don't get an answer here, try asking in
microsoft.public.word.vba.userforms

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
J

Johnnyboy5

If you don't get an answer here, try asking in
microsoft.public.word.vba.userforms

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USAhttp://word.mvps.org

ok - cool
 
J

Jay Freedman

Here are two suggestions for seeing the list of bookmark names:

1. Click in the document and display the Bookmarks dialog (shortcut: Alt+I, then K). Unfortunately, you can't type in the code while that dialog is displayed.

2. In the VBA editor, click View > Immediate Window. Then run this little macro to make a list of the bookmarks appear in the Immediate Window:

Sub x()
Dim bk As Bookmark
For Each bk In ActiveDocument.Bookmarks
Debug.Print bk.Name
Next
End Sub

The shortcut to the View Code screen is F7, and the shortcut to the design screen is Shift+F7 (these are listed on the right side of the View menu in the editor).
 
J

Johnnyboy5

Here are two suggestions for seeing the list of bookmark names:

1. Click in the document and display the Bookmarks dialog (shortcut: Alt+I, then K). Unfortunately, you can't type in the code while that dialog is displayed.

2. In the VBA editor, click View > Immediate Window. Then run this littlemacro to make a list of the bookmarks appear in the Immediate Window:

Sub x()
Dim bk As Bookmark
For Each bk In ActiveDocument.Bookmarks
    Debug.Print bk.Name
Next
End Sub

The shortcut to the View Code screen is F7, and the shortcut to the design screen is Shift+F7 (these are listed on the right side of the View menu in the editor).

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroupso all may benefit.

Loving your work - nice macro - just what I needed - learning fast.

Johnny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top