Solved

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

Posted on 2004-04-08
3
138 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

867 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now