Thanks for that Greg it has helped a lot however
as the letter evolves i find that i want to ask a further question and if
the answer is yes i want to collect 6-7 pieces of information from the user
and place them in bookmarks
also i want this to be used by several users on the network how can i copy
the document and all macro's and autotexts to public folder if i copy letter
to public folder the macro doesn't run and the last inserted text appears.
sorry i'm new to this and probably will end up with more questions than
answers
> Colm,
>
[quoted text clipped - 26 lines]
> End If
> End Sub
Greg Maxey - 21 Apr 2006 17:31 GMT
Colm,
I would again suggest that you look into using a userform to gather all
of the data in advance.
Extending the AutoNew (to fire on new documents created from a
template, while AutoOpen fires when an existing docuement is opened)
macro to your question, you could do something like this:
Sub AutoNew()
If InputBox("Do you like beer?", "Question", "Yes") = "Yes" Then
AskMoreQuestions
Else
AskLessQuestions
End If
End Sub
Sub AskMoreQuestions()
Dim oDoc As Word.Document
Dim BMRange As Word.Range
Set oDoc = ActiveDocument
Set BMRange = oDoc.Bookmarks("Answer1").Range
BMRange.Text = InputBox("What kind of beer do you like?", "Type")
oDoc.Bookmarks.Add "Answer1", BMRange
Set BMRange = oDoc.Bookmarks("Answer2").Range
BMRange.Text = InputBox("How much beer do you like?", "Type")
oDoc.Bookmarks.Add "Answer2", BMRange
End Sub
Sub AskLessQuestions()
'Code similar to the previous macro
End Sub
For your second question, I have no network smarts. It seems to me
that if you publish your template to the network then all of the macros
will be available to user creating documents with that template.