Close Document afterwards

M

Mamue

Hi,

how it is possible to close a document after adding a new one? i don't
know how to store the old document in a variable to close it
afterwards, like that:

Dim oldDoc as Document = ActiveDocument
Documents.add "Normal.dot"
oldDoc.close()

do you have an idea? is it possible to add a new document but keep the
old one active?

cheers, m
 
G

Graham Mayor

Dim oldDoc As Document
Set oldDoc = ActiveDocument
Documents.Add "Normal.dot"
oldDoc.Close

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Mamue

Dim oldDoc As Document
Set oldDoc = ActiveDocument
Documents.Add "Normal.dot"
oldDoc.Close

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

i knew that i forgot the "Set" ;-) Thanks
 

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