Get the name of the file open

Get the name of the file open

Anonymous
Not applicable
165 Views
3 Replies
Message 1 of 4

Get the name of the file open

Anonymous
Not applicable
I need to know how to get the name of the file that is open and open the
same drawing on a different drive. The other problem is the paths are not
same. So how can I do this with VBA
0 Likes
166 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Hi TJ,

There's a .dvb file for you in CF "Duplicate File for TJ". Virtually all of
the code in the module was donated by John Wilde in this NG a few months
ago. I stuck a little public sub in front of it. As it sits it will build
an array of all dwg files starting with D:\ (sStartPath = "D:\") and include
all dwg files in every directory thereunder. Then it will search the array
for a drawing named the same as the active drawing. You should be able to
change the sStartPath = "D:\" to wherever you want to start looking. Hope
that's what your looking for.

Gary
0 Likes
Message 3 of 4

Anonymous
Not applicable
TJ:

dim dwgName as string
dim newPath as string
newPath = "c:\xx\"
dwgName = Thisdrawing.Name
ThisDrawing.Application.Documents.Open(newPath & dwgName)

Gaston Nunez

TJ Robinson wrote:

> I need to know how to get the name of the file that is open and open the
> same drawing on a different drive. The other problem is the paths are not
> same. So how can I do this with VBA
>
0 Likes
Message 4 of 4

Anonymous
Not applicable
Where is this .dvb file you're referring to? I'm also trying to search the hard drive for duplicate files, and have had some trouble.
0 Likes