Closing single word window

K

Kezza

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.

I can close the document and I can close all the word windows and I can
close the window if there are other word windows open.

I have tried the following
Me.Application.ActiveWindow.Close
Windows("conquest report.doc").Parent.Close
SaveChanges:=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
 
D

Doug Robbins - Word MVP

If it's the active document, then use:

ActiveDocument.Close wdDoNotSaveChanges

If it is not the active document, then you need somewhere else in your code
to have declared a document object that you Set to the document that you
want to close.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
K

Kezza

Hi Doug
Thanks but this does not help me. Sorry if I havn't explained clearly. The
issue is that if this is the only document left open.. it closes the
document but still leaves the word window open.

If there is more that one document window open it works as I want it to.
But not when it is the only document open.

Help would be appreciated
 

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