Copy pages from a new document to an existing one

J

justagrunt

Hello,
Thru automation, I can get a mail merge to work to create a letter with
address etc, and the document becomes visible.

How do I open a second document (I have its path).
Copy its contents.
Do I use;
Activedocument.Range.copy?????????
or
Activedocument.Wholestory.copy?????

Then paste it to the first document:
Activedocument.selection.paste ?????????
so that the contents appear

But the second document is now closed.

Any help would really be appreciated.
I have had error messages that say along the lines that the method is
unsupported.
 
G

Graham Mayor

Why not simply insert an Includetext field in the merge document to insert
the second document (or a bookmarked part of it) during the merge?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

justagrunt

Thanks Graham,
I have a reference bookmark established on the mail merge form which I was
hoping would be the location for the pastings.

If there were a number of possible documents to be added in the mail merge
(letter) , not all would be used, but the possibility is that they could.
Would the method of "Includetext" work? If there were 11 posible documents
which could be added?
The letter could have conditions of contract added or scope of work, a
brocher etc.
These documents are selected via a control. If the control is true the
document is copied to the mail merge letter - that was the hope.
The whole of each selection would be added not say a portion of each - hense
the need for the entire pages to be copied and pasted if necessary for each
selection.
 
G

Graham Mayor

You can do all of this with conditional fields or combination fields in the
merge provided the data contains sufficient information to identify which
document to include. See my web pages http://www.gmayor.com/SelectFile.htm
and http://www.gmayor.com/mail_merge_graphics.htm (the principle of which is
similar) for some techniques.

However if you are creating a template to insert boilerplate text in a
document to an individual (rather than a merge to a group) then investigate
autotext as a means of storing your data in the template for insertion and
perhaps the autotextlist field.

See also http://www.gmayor.com/Macrobutton.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

justagrunt

Apology for disturbing yoiu again Graham,
Your tips "Insert text based on choice from a dropdown form field" is what I
would like to use.
My control form is in access, there are 11 sections. The form consists of
yes.no tick boxes to select.
If I use an if statement to select each section how then do I adjust the
macro code to utilise the insert text. Seraching for an example really.
I.e
If Me! Section11 = true then
"somthing here to send to word insert text.
else
'do nothing
end if

etc for the next 10.

Struggling to understand the basics here.
Any help appreciated.
 
G

Graham Mayor

I don't know enough about Access to make that stretch. What I was directing
you to in the links was not the macro but the means to use an INCLUDETEXT
field based on the result of a field in your data source. e.g.

{IF(Mergefield Fieldname} = "Result" {INCLUDETEXT "C:\\path\\{Mergefield
result}.doc"}}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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