Re: Close word window usering VBA
- From: Kezza <Kezza@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 17:54:00 -0700
Hi There
thanks,but this does not work for me. I did try that combination and it
does not work.
If the word document is the only document open and you close the document
(or active window) it leaves the word window open. I would like a command
that closes this window as well.
Thanks
"Valmont" wrote:
Hello Kezza..
Here's an idea which you can use often:
1) Open a few documents
2) Start the Macro Recorder
3) Close a single document (leave the others open)
4) Stop the Macro Recorder
5) Press "F11" to go into the IDE and learn from that code
6) Type a few things of this code in google, and find out how others use
this code. They may have smarter or better ideas which handle odds and ends.
Basically this is your code:
Windows("Doc2.doc").Activate
ActiveDocument.Close
So your combinations were close, but you haven't tried this one yet :)
~Val
"Kezza" <Kezza@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:91A1701F-0E3D-46F6-A9E4-5E496D04AFDF@xxxxxxxxxxxxxxxx
Hi There
I am trying to work out how to close a single word window without closing
any other word windows that might be open.
The issue is that if this is the only document left open.. it closes the
document but still leaves the word window open.
I have tried the following
Me.Application.ActiveWindow.Close
Windows("conquest report.doc").Parent.Close
SaveChanges:=wdDoNotSaveChanges
ActiveDocument.Close wdDoNotSaveChanges
Windows("A.doc").Application.Quit
Non of this code gives me the solution I am looking for.
I would really appreciate some assistance.
Thanks
- Follow-Ups:
- Re: Close word window usering VBA
- From: JP
- Re: Close word window usering VBA
- References:
- Close word window usering VBA
- From: Kezza
- Re: Close word window usering VBA
- From: Valmont
- Close word window usering VBA
- Prev by Date: Re: Close word window usering VBA
- Next by Date: Re: Close word window usering VBA
- Previous by thread: Re: Close word window usering VBA
- Next by thread: Re: Close word window usering VBA
- Index(es):
Relevant Pages
|
Loading