[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

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?
0
gilbar
Asked:
gilbar
1 Solution
 
doubleglazing2Commented:
what do u mean by 'attached'? What is it that u wanna chek it its attached to?
0
 
zzzzzoocCommented:
Try.. If TypeName(d)="Nothing"
0
 
gilbarAuthor Commented:
That what i needed! Thnax zzzz.  I Knew there had to be a command out there
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now