Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Close Document afterwards

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mamue - 10 Dec 2007 10:00 GMT
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
Graham Mayor - 10 Dec 2007 10:45 GMT
Dim oldDoc As Document
Set oldDoc = ActiveDocument
Documents.Add "Normal.dot"
oldDoc.Close

Signature

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

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

> Hi,
>
[quoted text clipped - 10 lines]
>
> cheers, m
Mamue - 10 Dec 2007 12:11 GMT
> Dim oldDoc As Document
> Set oldDoc = ActiveDocument
[quoted text clipped - 23 lines]
>
> > cheers, m

i knew that i forgot the "Set" ;-) Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.