#1   Report Post  
Posted to microsoft.public.word.docmanagement
Noella Noella is offline
external usenet poster
 
Posts: 5
Default Bookmarks

I've a template containing bookmarks and I've created a UserForm to populate
the bookmarked areas of the template. I've also cross-referenced the
bookmarks. Unfortunately, the information is replacing the bookmarks so the
cross-references don't work. How do I stop the bookmarks from being deleted?

Thanks for any help and assistance you can give me.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Bookmarks

Hi Noella,

If your text goes into a formfield on the document, try something based on:

Sub UpdateBookmark (BmkNm as string, MyTxt as string)
If ActiveDocument.Bookmarks.Exists(BmkNm) Then
ActiveDocument.Bookmarks(BmkNm).Range.Fields(1).Re sult.Text = MyTxt
End if
End sub
where BmkNm and MyTxt are variables holding your bookmark name and text, respectively.

Otherwise, if you're just populating stanadard bookmarks, try:

Sub UpdateBookmark (BmkNm as string, MyTxt as string)
Dim BmkRng as Range
If ActiveDocument.Bookmarks.Exists(BmkNm) Then
Set BmkRng = ActiveDocument.Bookmarks(BmkNm).Range
BmkRng.Text = MyTxt
ActiveDocument.Bookmarks.Add BmkNm, BmkRng
End if
Set BmkRng = Nothing
End sub
where BmkNm and MyTxt are variables holding your bookmark name and text, respectively.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Noella" wrote in message ...
I've a template containing bookmarks and I've created a UserForm to populate
the bookmarked areas of the template. I've also cross-referenced the
bookmarks. Unfortunately, the information is replacing the bookmarks so the
cross-references don't work. How do I stop the bookmarks from being deleted?

Thanks for any help and assistance you can give me.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2007 bookmarks - How to display bookmarks on page? rgille Microsoft Word Help 2 April 27th 23 02:55 AM
Bookmarks ll Microsoft Word Help 6 April 18th 07 09:45 AM
bookmarks Zimmo Microsoft Word Help 4 December 21st 06 11:54 PM
Bookmarks.. how do you know where they are exactly??? [email protected] Microsoft Word Help 2 December 2nd 06 12:06 AM
Bookmarks Brady Finney Tables 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 06:13 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"