reference an environ in a merge file

S

slickdock

I need to use {INCLUDETEXT} in a merge form file. I need to specify
the path to the {INCLUDETEXT} file to be the equivalent of %appdata%.
I tried these without luck:

{INCLUDETEXT Environ(appdata) & "\\mergeform.doc"}
{INCLUDETEXT "Environ(appdata) & \\mergeform.doc"}
{INCLUDETEXT "Environ(appdata)" & "\\mergeform.doc"}
etc., with lots of combinations of quotes, single backslashes and
double backslashes.

Any help would be appreciated.
TIA.
 
S

slickdock

Hi slickdoc,

Sorry, but you can't do that.

However, if the path to mergeform.doc is related to the current document's path, you may be able to implement the relative path
solution I've posted at:http://www.wopr.com/index.php?showtopic=670027

--
Cheers
macropod
[MVP - Microsoft Word]



I need to use {INCLUDETEXT} in a merge form file. I need to specify
the path to the {INCLUDETEXT} file to be the equivalent of %appdata%.
I tried these without luck:
{INCLUDETEXT Environ(appdata) & "\\mergeform.doc"}
{INCLUDETEXT "Environ(appdata) & \\mergeform.doc"}
{INCLUDETEXT "Environ(appdata)" & "\\mergeform.doc"}
etc., with lots of combinations of quotes, single backslashes and
double backslashes.
Any help would be appreciated.
TIA.- Hide quoted text -

- Show quoted text -

There must be a way. I've never heard anyone give up so fast! ;-)
What about a macro that starts the merge and gives some kind of set or
assign command to pass the path to Word, so that it can be used with
the {INCLUDETEXT} command?

TIA.
 
M

macropod

Hi slickdoc,

If you're using a macro, there's no need for the INCLUDETEXT field - you can simply insert the source document directly via the
macro code.

--
Cheers
macropod
[MVP - Microsoft Word]


Hi slickdoc,

Sorry, but you can't do that.

However, if the path to mergeform.doc is related to the current document's path, you may be able to implement the relative path
solution I've posted at:http://www.wopr.com/index.php?showtopic=670027

--
Cheers
macropod
[MVP - Microsoft Word]



I need to use {INCLUDETEXT} in a merge form file. I need to specify
the path to the {INCLUDETEXT} file to be the equivalent of %appdata%.
I tried these without luck:
{INCLUDETEXT Environ(appdata) & "\\mergeform.doc"}
{INCLUDETEXT "Environ(appdata) & \\mergeform.doc"}
{INCLUDETEXT "Environ(appdata)" & "\\mergeform.doc"}
etc., with lots of combinations of quotes, single backslashes and
double backslashes.
Any help would be appreciated.
TIA.- Hide quoted text -

- Show quoted text -

There must be a way. I've never heard anyone give up so fast! ;-)
What about a macro that starts the merge and gives some kind of set or
assign command to pass the path to Word, so that it can be used with
the {INCLUDETEXT} command?

TIA.
 
S

slickdock

Hi slickdoc,

If you're using a macro, there's no need for the INCLUDETEXT field - you can simply insert the source document directly via the
macro code.

--
Cheers
macropod
[MVP - Microsoft Word]


Hi slickdoc,
Sorry, but you can't do that.
However, if the path to mergeform.doc is related to the current document's path, you may be able to implement the relative path
solution I've posted at:http://www.wopr.com/index.php?showtopic=670027
- Show quoted text -

There must be a way. I've never heard anyone give up so fast! ;-)
What about a macro that starts the merge and gives some kind of set or
assign command to pass the path to Word, so that it can be used with
the {INCLUDETEXT} command?

TIA.- Hide quoted text -

- Show quoted text -

Thank you. Could you point me to an example of such a miraculous
thing? And how can I specify an insertion position in said document?
 
M

macropod

Hi slickdoc,

To do this you'd use the InsertFile method which, at its most basic is simply:
Selection.InsertFile FileName:="Document.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False

For your purposes, instead of using 'Selection', you'd specify the insertion point as a range - which could be identified via a
bookmark or a unique character string, or known location (eg the start or end of the text or at the top of a particular page) in the
document. With the bookmark or character string approach, the exact method varies, depending on whether you want to preserve said
bookmark or character string.

A web search is bound to turn up some examples of these.

--
Cheers
macropod
[MVP - Microsoft Word]


Hi slickdoc,

If you're using a macro, there's no need for the INCLUDETEXT field - you can simply insert the source document directly via the
macro code.

--
Cheers
macropod
[MVP - Microsoft Word]


Hi slickdoc,
Sorry, but you can't do that.
However, if the path to mergeform.doc is related to the current document's path, you may be able to implement the relative path
solution I've posted at:http://www.wopr.com/index.php?showtopic=670027
- Show quoted text -

There must be a way. I've never heard anyone give up so fast! ;-)
What about a macro that starts the merge and gives some kind of set or
assign command to pass the path to Word, so that it can be used with
the {INCLUDETEXT} command?

TIA.- Hide quoted text -

- Show quoted text -

Thank you. Could you point me to an example of such a miraculous
thing? And how can I specify an insertion position in said document?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top