Tech Support Forum banner
Status
Not open for further replies.
1 - 3 of 3 Posts

· Registered
Joined
·
5 Posts
Discussion Starter · #1 ·
Hi - I am new to using VB in word macros and am struggling to identify a line of code to detect the presence of an open document, and if no ducument is present then to open a new one.
I have tried the following without success.

If Document = False Then
Documents.Add DocumentType:=wdNewBlankDocument
EndIf

The first line must be wrong.
Help greatly appreciated !!
Astrikor
 

· Registered
Joined
·
5 Posts
Discussion Starter · #2 ·
So, I have answered my own question (how often does that happen?)

The solution is as follows:

If Windows.Count = 0 Then
Documents.Add DocumentType:=wdNewBlankDocument
EndIf

Happy Days !!
Astrikor
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top