Copy Merge fIelds From one word document to another in VB.net

Posted by MetaDan on Stack Overflow See other posts from Stack Overflow or by MetaDan
Published on 2009-08-21T13:55:53Z Indexed on 2010/06/16 16:02 UTC
Read the original article Hit count: 227

Filed under:
|
|

Hi,

I'm editing a vb.net app for a mate and part of the requirements are to copy merge fields from one word document to another. I can copy them across using document.content.text but they come out as text (should've figured this i guess).

I think i've got them selected by:

Dim tDocFields As Microsoft.Office.Interop.Word.Fields
tDocFields = tDocument.Content.Fields

I'm then activating the doc i want to copy into and i think i need to then copy into that doc using the related word app.

vDocument.Activate()
vWord.Selection. ??? Insert() ???

Any pointers would be greatly appreciated... Am i on the right lines even?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net