S
sylvian stone
Hi,
I wonder if somebody could answer this question - I'm sure it has been
asked many times before, but just cannot seem to figure it out.
If I define a variable for a pathname - i.e. a = "C:\MyFolder\MyPath\"
to be interpolated in either a insertFile or Open command, I could
execute:
myRange.InsertFile a & "myfile.doc"
but if tried this with
Documents.Open (a & "myfile.doc")
it will come up with a 'file not found' error.
If I hardcode the Documents.Open to:
Documents.Open ( "C:\MyFolder\MyPath\myfile.doc")
it works.
Is there a way to make 'Open' work with variables instead of specifying
the exact path (which could change in the future..)
Thanks
SS
I wonder if somebody could answer this question - I'm sure it has been
asked many times before, but just cannot seem to figure it out.
If I define a variable for a pathname - i.e. a = "C:\MyFolder\MyPath\"
to be interpolated in either a insertFile or Open command, I could
execute:
myRange.InsertFile a & "myfile.doc"
but if tried this with
Documents.Open (a & "myfile.doc")
it will come up with a 'file not found' error.
If I hardcode the Documents.Open to:
Documents.Open ( "C:\MyFolder\MyPath\myfile.doc")
it works.
Is there a way to make 'Open' work with variables instead of specifying
the exact path (which could change in the future..)
Thanks
SS