We help IT Professionals succeed at work.

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

gilbar
gilbar asked
on
Medium Priority
179 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?
Comment
Watch Question

what do u mean by 'attached'? What is it that u wanna chek it its attached to?
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
That what i needed! Thnax zzzz.  I Knew there had to be a command out there
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.