Templace Doc

  • Thread starter Continental Translations
  • Start date
C

Continental Translations

I am hoping to make a template such as the following:-

On [insert date] at [insert time], I was at [insert location] with [insert
friends]. We visited [insert places you visited] and did [insert activites].

Now, what I would like is for when I open the document, for a serious of
questions to pop up in MS Word, for example, "insert date," "insert time,"
"insert location" etc..... and then all these fields fill in automatically.
It's similar to those website you can go to where you get asked a serious of
questions and it then automatically personalises a story for you!

I am using Office 2000.

Thanks all
 
T

Tammy

Hi,

Using Word's fill-in field would be the easiest way to do it if you
didn't want to create it using VBA. If you type in "Field" in Word's
help one of the items listed is "Field codes - fillin field". This
will explain what it does in more detail.

To automate the template so the field displays the prompts in a dialog
box when it is used, you will need to update the fields when the
template is run.

If you copy this code to the Document_New module of your template, it
will select the document, update the fields so all the prompts appear
then unlink the fields afterwards. This will stop the prompts
reappearing if the fields in the document are updated again. If you
have other fields in the document that should be linked though, you
may need to take this line out.

Private Sub Document_New()
With Selection
.WholeStory
.Fields.Update
.Fields.Unlink
.HomeKey Unit:=wdLine
End With
End Sub

Hope this helps,

Tammy
 

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