
Difficulties with bookmarks in a word template
Hi Camilla,
You will have to populate the UserForm with defaults
as set in the bookmarks (Bookmark.Range.Text.), something like:
Userform initializes and you go:
'getting default values
TextBox1 = ActiveDocument.BookMarks("MyBookMark").Range.Text
Userform after first run:
'Returning userform (adjusted or not) values to document
ActiveDocument.BookMarks("MyBookMark").Range.Text = TextBox1
Calling userform again:
'same story as intializing first run (and doing so repeatedly ...)
TextBox1 = ActiveDocument.BookMarks("MyBookMark").Range.Text
summarizing: place default values in bookmarks, pick up these bookmarks
values
when initializing.
Note: Uncheck the OverWrite Selection checkbox in Tools|Options tab Edit
This will ensure that bookmarks won't be deleted after insertion of text.
If the above is unclear, kindly repost.
Krgrds,
Perry
Quote:
> I am creating a Word dialog box for a simple letter template. Everything
> works fine apart from one problem. I would like to be able to recall the
> dialog box after the user has choosen OK. A user might change his/her mind
> and want to go back to the initial dialog box and change the information
> that was originally entered.
> I have been bookmarks to set destination areas for the information in the
> dialog box but if I recall the box the information is added a second time.
> However.. I would like the dialog box to keep the original information but
> overwrite what was written in the document the second time I use it. So..
> How can I delete just a word filled in by a dialog box and is there a
better
> way to do this than using bookmarks?
> Thanks in advance
> Camilla