UserForm that creates a document based on a Template

S

Shauna Koppang

I am a rank beginner and just learned how to create a
userform using the MVPs site instructions. I posted this
earlier but don't enought VBA to do this.

I have a requirement where a user needs to create a series
of documents based on a templates. It is a law firm and
say if they have to do a foreclosure they need to create 1
document and right after create another, and so on in a
series. They originally had hyperlinks to these documents
in sequence, and we have now converted them into templates
but of course when you use the hyperlinks it opens the
template, not a document based on that template. I got
the suggestion that UserForms would be the ideal way to do
this from this Newsgroup... but I don't know how. Any
suggestions on how to do this would be appeciated fr where
to look for code I could learn to do this from.
Thanks!
Shauna
 
S

Shauna Koppang

Amazing what a little effort will yeild:

Private Sub CommandButton1_Click()
With ActiveDocument
If OptionButton1.Value = True Then
'Create a new document based on a template
Documents.Add "C:\Precedents\Sample.Dot"
Documents.Add "C:\Precedents\Sample2.Dot"
Else
' Create a new document based on a template
Documents.Add "C:\Precedents\Agreement.Dot"
Documents.Add "C:\Precedents\Offer.Dot"
End If
End With

UserForm1.Hide
End Sub

Thanks for listening to my ramblings and I hope this may
help all the other new VBA users out there.
Shauna
 

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