Alternative to InsertBefore Bookmark Command

V

VicCahoon

I have some standard letters in Word that use forms to collate the data and
then inserts the data into predefined bookmarks through-out the document (I
have listed some examples below)

Whilst this works fine, the code is not very foolproof as it relies on the
user NOT clicking the save button. If they do the current text is saved and
the next time they use the Standard Letter they still have the old details
on the document and then if they enter new data it is appended before the
old data.

Is there an alternative or someway of ensuring that the old text is cleared
off before new data is inserted?

I have considered disabling the 'Save' button and only allowing 'Save As'
but was hoping for a way of simply clearing the old data out and then insert
new text.

Any suggestions would be extremely welcome.

Thank you

ActiveDocument.Bookmarks("InsuredName").Range.InsertBefore fldName
ActiveDocument.Bookmarks("InsuredAddress").Range.InsertBefore fldAddress
ActiveDocument.Bookmarks("Salutation").Range.InsertBefore fldSalutation
 
M

Martha

VicCahoon said:
[...] Whilst this works fine, the code is not very foolproof as it relies
on the user NOT clicking the save button. If they do the current text is
saved and the next time they use the Standard Letter they still have the old
details on the document and then if they enter new data it is appended before > the old data. [...]

Unless I'm totally misunderstanding you, that's precisely the problem
templates are meant to solve. Open the Standard Letter, Save As, in
the 'Save as type' box, select "Document Template (*.dot)". Distribute
this .dot file to your users, not the original .doc. They double-click
the template and get a new file based on it, where they can do
whatever horrible things they want to do, including Save, without
affecting what happens the next time they want to write a Standard
Letter.
 
V

VicCahoon

Yes!! Your exactly right. This is an absolutely typical case of not being
able to see the forest for the trees.

Thanks for opening my eyes

Cheers
Martha said:
VicCahoon said:
[...] Whilst this works fine, the code is not very foolproof as it relies
on the user NOT clicking the save button. If they do the current text is
saved and the next time they use the Standard Letter they still have the old
details on the document and then if they enter new data it is appended
before > the old data. [...]

Unless I'm totally misunderstanding you, that's precisely the problem
templates are meant to solve. Open the Standard Letter, Save As, in
the 'Save as type' box, select "Document Template (*.dot)". Distribute
this .dot file to your users, not the original .doc. They double-click
the template and get a new file based on it, where they can do
whatever horrible things they want to do, including Save, without
affecting what happens the next time they want to write a Standard
Letter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top