Documents.Open

Documents.Open

Anonymous
Not applicable
237 Views
2 Replies
Message 1 of 3

Documents.Open

Anonymous
Not applicable
The AutoCAD ActiveX and VBA Reference states that the syntax for the open
method is as follows:

Application.Documents.Open Name[, ReadOnly]

The documentation goes on to say "If the drawing is in the folder specified
by the SupportPath property, then the path is not needed and the file name
is sufficient." regarding the Name argument.

I have not found this to be true. I always have to provide the full path
regardless of whether the drawing I am opening is in one of the folders
listed in SupportPath. Am I missing something obvious here?

Thanks,

Chuck
0 Likes
238 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Chuck Gabriel had this to say:

> Am I missing something obvious here?

Chuck,

Even if it did work (wouldn't know, never tested it, never will) this is one
"feature" you're better off without. There's no point in gambling on which
file will be opened; there could well be more than one file bearing the same
name in multiple search path folders.

Using an explicit guarantees the right document every time, assuming it
exists.

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi Frank.

Sorry it took me so long to get back to you on this one. I just got back
from vacation.

I see your point. I wanted to avoid hard coding the path to improve
portability. I guess I will could FindFile(strFileName) and then use the
return value in my Open statement. For some reason that never occurred to
me before. I guess it was because I was frustrated with my initial effort.

Thanks.

Chuck


"Frank Oquendo" wrote in message
news:4DD8ECFFA2EDA3E83C9AAAC3972D5CCA@in.WebX.maYIadrTaRb...
> Chuck Gabriel had this to say:
>
> > Am I missing something obvious here?
>
> Chuck,
>
> Even if it did work (wouldn't know, never tested it, never will) this is
one
> "feature" you're better off without. There's no point in gambling on which
> file will be opened; there could well be more than one file bearing the
same
> name in multiple search path folders.
>
> Using an explicit guarantees the right document every time, assuming it
> exists.
>
> --
> "If you want to be somebody else change your mind"
> http://www.acadx.com
> http://vbxtender.sourceforge.net
>
>
0 Likes