Re: Close word window usering VBA
- From: Kezza <Kezza@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 16 Apr 2008 18:31:00 -0700
Thanks Keith
Thats excellent... don't know why I didn't think of it. I am using the 2002
version of word so the code for me was
If Documents.Count = 1 Then
' Close word without saving
Application.Quit wdDoNotSaveChanges
Else
' Close document without saving
ActiveDocument.Close wdDoNotSaveChanges
End If
Thanks very much
"KeithM" wrote:
This works for me in Word 2003.
ActiveDocument.Close
If Documents.Count = 0 Then
Application.Quit
End if
Hope that helps!
"Kezza" <Kezza@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
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
- References:
- Close word window usering VBA
- From: Kezza
- Re: Close word window usering VBA
- From: KeithM
- Close word window usering VBA
- Prev by Date: Linking Excel Database to Word Document
- Next by Date: I set olImportanceHigh but i outlook,the priority change to low?
- Previous by thread: Re: Close word window usering VBA
- Next by thread: Ms Office Task Pane
- Index(es):
Relevant Pages
|
Loading