Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-08
3
Medium Priority
?
164 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

972 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