Help with Bookmarks and userforms 
Author Message
 Help with Bookmarks and userforms

GDay there,

I have set up a document with bookmarks for us with a userform. Works OK,
however the bookmarked fields only show up with the "[" and not a more
descriptive thing like"[Name]". Does anyone know how I can get this to
occur.

If I type the word "Name" where the bookmark should be, highlight it and
then choose Insert|Bookmark it does what I want i.e. "[Name]", however it
creates the document with the following - "Joe BloggsNAME".

Any ideas ?

Adam



Fri, 27 Jun 2003 07:59:45 GMT  
 Help with Bookmarks and userforms
Hi Adam,

Try code like:

------------------------------------------------------------
Dim oRange As Range

  'Check to see if the bookmark is there
  If ActiveDocument.Bookmarks.Exists("Bookmark1") Then
    Set oRange = ActiveDocument.Bookmarks("Bookmark1").Range
    oRange.Text = TextBox1.Text
    'The bookmark is gone now, so you need to add it again
    ActiveDocument.Bookmarks.Add name:="Bookmark1", Range:=oRange
  End If
  Set oRange = Nothing
------------------------------------------------------------

Hope this helps,
regards,
Astrid

So that all can benefit from the discussion,
please post all followups to the newsgroup.

Visit the MVP Word FAQ site at http://www.mvps.org/word/
For direct access to all Microsoft newsgroups:



Quote:
> GDay there,

> I have set up a document with bookmarks for us with a userform. Works OK,
> however the bookmarked fields only show up with the "[" and not a more
> descriptive thing like"[Name]". Does anyone know how I can get this to
> occur.

> If I type the word "Name" where the bookmark should be, highlight it and
> then choose Insert|Bookmark it does what I want i.e. "[Name]", however it
> creates the document with the following - "Joe BloggsNAME".

> Any ideas ?

> Adam



Fri, 27 Jun 2003 09:03:03 GMT  
 Help with Bookmarks and userforms
I suspect that what you want is a "form" rather than a "userform." A
userform is a VBA component used for building your own dialog boxes.

Take a look at:
http://www.addbalance.com/usersguide/forms.htm (very rough but good links)

You may want to download the following and take a look at them.
http://www.addbalance.com/word/download/AskForm.zip and
http://www.addbalance.com/word/download/UserForm.zip.

See also http://www.mvps.org/word/FAQs/TblsFldsFms/LinesInForms.htm


Quote:
> GDay there,

> I have set up a document with bookmarks for us with a userform. Works OK,
> however the bookmarked fields only show up with the "[" and not a more
> descriptive thing like"[Name]". Does anyone know how I can get this to
> occur.

> If I type the word "Name" where the bookmark should be, highlight it and
> then choose Insert|Bookmark it does what I want i.e. "[Name]", however it
> creates the document with the following - "Joe BloggsNAME".

> Any ideas ?

> Adam



Sun, 29 Jun 2003 07:07:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Word Bookmarks, Userforms and Updates

2. Bookmarks, References and Userforms

3. userforms for bookmarks

4. UserForms, Textboxes & Bookmarks

5. bookmarks & userforms

6. Bookmarks in userforms, how do you populate more then one place

7. two questions on how to get data entries in userforms into bookmarks (if possible at all)

8. Check Boxes, Userforms Bookmarks

9. VBA help window: Multiple windows/tabs, bookmarks, bookmarks/history pane

10. Taking data out of Userforms - help required

11. Help needed for userforms

12. no valid bookmark error message, without using bookmarks at all

 

 
Powered by phpBB® Forum Software