|
-
Jan 10th, 2001, 07:20 AM
#1
Thread Starter
Addicted Member
is there a way of finding out that there are more than one active window open,
what i need to do is close a word document that i am working on. which it does.
but if it is the only word document open then it will only close the document, but if there is another word document open it will close the actual window with the document. in other words it will exit out of word for that particular document.
but will leave the other documents open.
i have tried using the active.close option.
and have tried using application.quit method.
what i need to do is something like
if more than one word document open then
activewindow.close
else
application.quit
-
Jan 10th, 2001, 07:25 AM
#2
Retired VBF Adm1nistrator
You could try using DDE.
I have no idea how or what you can do, but things like that can be done through DDE i believe
- jamie.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jan 10th, 2001, 09:09 AM
#3
Thread Starter
Addicted Member
eh?
i have never used this before can you give me an example or somewhere i can get more information about this
-
Jan 10th, 2001, 10:10 AM
#4
Retired VBF Adm1nistrator
sorry, I know nearly nothing about DDE except that you can use it to communicate with other programs in windows.
sorry i cant be of anymore help :/
- jamie
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Jan 10th, 2001, 11:53 AM
#5
Lively Member
Similar on Excel
Not sure on word but on Excel there's a Workbooks collections. This collection contains an entry for each open workbook, thus you can loop through and close/activate whichever one you like.
I've never looked at automating Word but I'm pretty certain there's a Documents collection. As per excel each item in this is a document object which has the necessary close events (or activate or whatever it is you wish to do).
Obviously myWord.documents.count would return the number of open documents you have. Have a nose round with the VB Object Browser and you should find what you want. (I presume you've added the Word object library to your app).
Hope this is of use, I know this is the scenario for Office 2000.
Anakim
It's a small world but I wouldn't like to paint it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|