Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Bookmarks to a ComboBox (Word 2000)

    Does anyone know how to add Bookmarks to a dropdown combo or list box in Word. I would like to be able to click on Internal Bookmarks within the document from choices in the dropdown box. I can't seem to find a way to add them. I have found that the switch /l allows you to jump to them, just haven't figured out how to use the switch, or even maybe how to assign a macro to each item in the list to carry me to the bookmark I click on in the dropdown box that I might choose. Any help would be so very appreciated. Thank you...
    Nannette <img src=/S/help.gif border=0 alt=help width=23 height=15>
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    New Lounger
    Join Date
    Sep 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Bookmarks to a ComboBox (Word 2000)

    Give this a try...

    Private Sub cboBookmarks_Click()
    Selection.GoTo wdGoToBookmark, , , cboBookmarks.Text
    End Sub

    Private Sub UserForm_Activate()
    Dim bm As Bookmark

    For Each bm In ActiveDocument.Bookmarks
    cboBookmarks.AddItem bm.Name
    Next
    End Sub

    Darryl

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Bookmarks to a ComboBox (Word 2000)

    Darryl,

    I so appreciate the help. I tried your code, yet something is still missing. I am not real good at this "code" thing yet. Maybe I can tell you what I am doing, and then you can tell me what I'm doing wrong.
    I am using the Combo box icon on the "Control Toolbox" toolbar. I create a document with bookmarks called "one", "two" and "three". I create the combo box, and then double-click on it and insert the code you gave me (copied and pasted). I close and return to the word document, and choose to exit design view and there is still nothing in my combo box, no bookmarks at all. Should I be adding something to the code you gave me? Or should it pick up the bookmarks within my document all by itself? i saved the Document as a template, and still I am having trouble. Does this help you know what I am doing wrong? Thanks for your extra time. It means a whole lot.

    Nannette <img src=/S/blank.gif border=0 alt=blank width=15 height=15>
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  4. #4
    New Lounger
    Join Date
    Sep 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Bookmarks to a ComboBox (Word 2000)

    Sorry, I wasn't sure if you'd be using a UserForm or not, so assumed you were...it would be better than using the ComboBox in the document itself for a couple reasons, namely that when the code moves to the bookmark, the ComboBox may be scrolled off the screen.

    In any case, here's how to put it on a UserForm:
    Open your document.
    Press Alt-F11 to get to the code window.
    In the Project window, Right-click on the project (it will probably be called "Project (Document 1)" or similar) and select Insert UserForm.
    You'll see a "Toolbox" similar to the one in your document view. Select your ComboBox and place it on the UserForm.
    Now, Right-click a blank area of the UserForm and select "View Code" and paste the code I sent earlier.
    Press F5 to run the code and you should now see your bookmarks in the ComboBox.

    Hope this is more of what you were looking for.
    I've created an add-in that actually places the ComboBox on a Toolbar. Unfortunately, it's not very portable since it contains some things that aren't very useable for others. If you're interested, let me know and I'll see what I can do for you.

    Darryl

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding Bookmarks to a ComboBox (Word 2000)

    Darryl,

    Sent you an email back on this last help that you gave me. If your not to disgruntled would you read, and send me a note back...I followed all your steps, and they all make good sense, its just something still is not working right.

    Thank you,
    Nannette
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •