Solved

in VBA how can if a document object is attached to a document?

Posted on 2004-04-08
3
145 Views
Last Modified: 2010-05-02
hey folks, lets say i have this code in word VBA:

Dim d As Document
Dim n As String
On Error Resume Next
Set d = Documents.Open(FileName:=fName)

'I want something next that will check if d is attached to a document (or if there was an error). I tried isEmpty ans isNull, but they don't seem to work.  I want a isExists(d) command that would tell me yes(or no) that document object is attached to something.  Does anyone know a a nice cool command that works like that?
0
Comment
Question by:gilbar
3 Comments
 
LVL 1

Expert Comment

by:doubleglazing2
ID: 10787684
what do u mean by 'attached'? What is it that u wanna chek it its attached to?
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 500 total points
ID: 10788258
Try.. If TypeName(d)="Nothing"
0
 
LVL 9

Author Comment

by:gilbar
ID: 10791097
That what i needed! Thnax zzzz.  I Knew there had to be a command out there
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA: Select SQL query based on a config Sheet v2 11 52
How to make an ADE file by code? 11 99
Automatic Email Reminder 4 70
Collapse and expand table in Word 2010 2 89
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question