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

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?
LVL 9
gilbarAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
zzzzzoocConnect With a Mentor Commented:
Try.. If TypeName(d)="Nothing"
0
 
doubleglazing2Commented:
what do u mean by 'attached'? What is it that u wanna chek it its attached to?
0
 
gilbarAuthor Commented:
That what i needed! Thnax zzzz.  I Knew there had to be a command out there
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.