Copy content from one Word document to another

P

Peter Karlström

Hi

Is it possibly to copy only the Word Story Content from one opened document
to another opened document without getting the page header and footer along
with it?

If I select the whole content of document 1, the target documents header and
footer gets messed up when I paste it.

Thanks in advance
 
J

Jialiang Ge [MSFT]

Hello Peter,

I am not sure if I understand the term "Word Story Content" correctly. Does
it mean the content in a word document excluding the headers and footers?
How did you copy & paste the content? programmatically or manually? If
manually, how did you select the content in the source document? Ctrl+A?

Based on my test, the header and footer will not be pasted if the target
document already has header or footer. Would you tell me more information
about how to reproduce the issue? Or would you send a sample document that
can reproduce the problem to my mailbox ([email protected])? I will then
research to see if it is an issue of the Office product.

Thanks for your efforts.
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
P

Peter Karlström

Hi Jialiang Ge

Sorry, but I had a configuration error in my COM Addin app which messed up the
pagefooter, so there were no errors in copy-paste procedure.

I use the following code to copy the text where toldDoc is source document
and tnewDoc is target document:
wrdApp.Windows(toldDoc).Document.Select
wrdApp.Selection.HomeKey wdStory
wrdApp.Selection.EndKey Unit:=wdStory, Extend:=wdExtend
wrdApp.Selection.Copy
wrdApp.Windows(tnewDoc).Document.Select
wrdApp.Selection.PasteAndFormat (wdPasteDefault)
wrdApp.Windows(tnewDoc).Selection.HomeKey wdStory
wrdApp.Windows(toldDoc).Selection.HomeKey wdStory


Thanks anyway
 
J

Jialiang Ge [MSFT]

No problem, Peter. I am glad to see you have found out the resolution by
yourself. If you have any other questions, please feel free to let me know
about. I'll do my best to help.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 

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