J
Jason McClean
HI,
I have several documents that have a Document_new() sub. When this is
executed (after a new document is created based on the original), the macro
extracts the path from the original document name, on which all other paths
in macros within the document are based.
If the original file is a template then this information can be gleaned from
ActiveDocument.AttachedTemplate.Path, but if the original document is a DOC
file, how could I do this?
The reason is that on opening the new document, macro code is imported from
bas & frm files from a relative path to the original document. I have
several servers where these documents are homed. The are connected via WAN
links, but the imported files must be read locally otherwise I have speed
implications (they would work but be very slooowwww).
Obviously, I could just make sure that the original files are all template
files (and I wish they were), but is there any other way in code to get this
information?
e.g.
original file : \\myserver\d\docs\myfile.doc
I create a new file based on the original which would then import files from
\\myserver\d\macros\import.
I don't want to hard code the paths in, so when I copy the file to
\\MySecondServer\e, the import files are read from
\\MySecondServer\e\macros\import
The reason I import code is so that I only have to maintain those files, so
everytime a new document is created, it runs the most up to date macros read
from the imported files.
Any ideas?
Cheers.
Jason
I have several documents that have a Document_new() sub. When this is
executed (after a new document is created based on the original), the macro
extracts the path from the original document name, on which all other paths
in macros within the document are based.
If the original file is a template then this information can be gleaned from
ActiveDocument.AttachedTemplate.Path, but if the original document is a DOC
file, how could I do this?
The reason is that on opening the new document, macro code is imported from
bas & frm files from a relative path to the original document. I have
several servers where these documents are homed. The are connected via WAN
links, but the imported files must be read locally otherwise I have speed
implications (they would work but be very slooowwww).
Obviously, I could just make sure that the original files are all template
files (and I wish they were), but is there any other way in code to get this
information?
e.g.
original file : \\myserver\d\docs\myfile.doc
I create a new file based on the original which would then import files from
\\myserver\d\macros\import.
I don't want to hard code the paths in, so when I copy the file to
\\MySecondServer\e, the import files are read from
\\MySecondServer\e\macros\import
The reason I import code is so that I only have to maintain those files, so
everytime a new document is created, it runs the most up to date macros read
from the imported files.
Any ideas?
Cheers.
Jason