Open as New document...

K

K. Wilder

Is there a way using VBA to open an existing document or a template as an
unnamed document, similar to double-clicking a .DOT file and having it open
as Document1?

I'm trying this but it only opens the document, which I don't want
overwritten:

Dim wd as Word.Application
Dim wDoc as Word.Document
Dim WordFile as string
WordFile = "test.doc"

Set wDoc = wd.Documents.Open(WordFile)

Thanks,

King Wilder
 
G

Ganeth

Simple - you need to do this instead:

Sub openTemplate()

Word.Documents.Add Template:="C:\path\To\My\Template.dot"

End Sub

That'll open a document, based on a template whose path you supply, as
'DocumentN', where N is the current number of docs, 1 to begin with.

G
 

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