check active document 
Author Message
 check active document

Hi all,

How to check if an active document is open.

i have the following code

If ActiveDocument.Name <> DocumentNaam Then
  ' do something
end if

when there is no  activeDocument i get an error.

how to get around this problem

--
Regards,
Marco
(University Hospital Maastricht)



Sat, 03 Aug 2002 03:00:00 GMT  
 check active document
Hi Marco,

If Documents.Count > 0 Then
    'There must be an ActiveDocument
End If

Quote:
> How to check if an active document is open.

> i have the following code

> If ActiveDocument.Name <> DocumentNaam Then
>   ' do something
> end if

> when there is no  activeDocument i get an error.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Sat, 03 Aug 2002 03:00:00 GMT  
 check active document
thanks

--
Regards,
Marco
(University Hospital Maastricht)
Cindy Meister -WordMVP- heeft geschreven in bericht ...

Quote:
>Hi Marco,

>If Documents.Count > 0 Then
>    'There must be an ActiveDocument
>End If

>> How to check if an active document is open.

>> i have the following code

>> If ActiveDocument.Name <> DocumentNaam Then
>>   ' do something
>> end if

>> when there is no  activeDocument i get an error.

>Cindy Meister
>INTER-Solutions, Switzerland
>http://homepage.swissonline.ch/cindymeister
>http://go.compuserve.com/MSOfficeForum

>This reply is posted in the Newsgroup; please post any follow question
>or reply in the newsgroup and not by e-mail :-)



Sun, 04 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. placing a checked logo in an active document

2. Active program: keeping the app active and checking time

3. Macro to insert text or document into active document

4. How to check if WordMail is active?

5. Checking for Active Word App

6. Checking for active internet connection.

7. Check for active app

8. Checking if an application is still active before sendkeys

9. checking if application is active

10. checking for existence of Active X object

11. NT4.0 and RAS, Checking for active connection

12. Checking Task List for Active Application

 

 
Powered by phpBB® Forum Software