Difficulties with bookmarks in a word template 
Author Message
 Difficulties with bookmarks in a word template

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



Sun, 20 Jul 2003 20:44:10 GMT  
 Difficulties with bookmarks in a word template
Hi Camilla,

I don't know exactly what the problem is but I have made a template for
proposals that works with bookmarks and dialog boxes. What I did is this:
the first time the dialog box is opened all the fields are empty. The user
supplies the necessary info and closes the dialog. When the dialog is opened
again, the fields are filled with the values from the bookmarks, which the
user can then modify. When the dialog is closed, all values are updated.

Is this what you mean? If you want a specific solution you have to supply me
with some code, I think. Let me know if you need any help.

Regards,
T

Sterling Waen
Theo van der Ster
Koewei 37
+31 26 3830950
The Netherlands



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



Mon, 21 Jul 2003 03:10:58 GMT  
 Difficulties with bookmarks in a word template
I ran into this weird quirk just last week. IF you define the bookmarks
around existing text and save the template that way, then VBA erases
the bookmarks when you change their content.

IF you define your bookmark at an insertion point, and save the
template with EMPTY bookmarks, then VBA will insert the text after the
bookmarks (retaining the bookmarks).

...Of course that means a more complicated procedure the second time
around....so if there aren't too many items to fill in, I'd recommend
using document properties and fields instead of bookmarks.

-dja



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

Sent via Deja.com
http://www.deja.com/


Mon, 21 Jul 2003 05:08:16 GMT  
 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



Mon, 21 Jul 2003 05:56:41 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Insert a formatted value in a Word template bookmark

2. Office XP only: Spurious bookmark added to Word document Automating Powerpoint from Word

3. Creating Word documents from an Embedded OLE Word Template

4. insert word object based on a word template?

5. Word 2002 Template won't open in Word 2000

6. Word Templates with VBA code running very slow in Word XP

7. Go to Bookmark upon opening document from template

8. Bookmarks in a template

9. Dynamic Bookmarks and Selecting the Correct Template

10. Word XP Template Error on Word 97

11. VBA in a workgroup template runs slower on Word 2002 than on Word 97

12. Templates and bookmarks

 

 
Powered by phpBB® Forum Software