Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

Close Document afterwards

 
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word vba beginners
View previous topic :: View next topic  
Author Message
Mamue
Guest





PostPosted: Mon Dec 10, 2007 10:00 am    Post subject: Close Document afterwards Reply with quote

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
Back to top
Google
Sponsor





PostPosted: Mon Dec 10, 2007 10:00 am    Post subject: Advertisement

Back to top
Graham Mayor
Guest





PostPosted: Mon Dec 10, 2007 10:45 am    Post subject: Re: Close Document afterwards Reply with quote

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

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Mamue wrote:
Quote:
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
Back to top
Mamue
Guest





PostPosted: Mon Dec 10, 2007 12:11 pm    Post subject: Re: Close Document afterwards Reply with quote

On 10 Dez., 11:45, "Graham Mayor" <gma...@REMOVETHISmvps.org> wrote:
Quote:
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


Mamue wrote:
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

i knew that i forgot the "Set" Wink Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word vba beginners All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum