Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 28 JUL 2012 03:20:39AM Mark Boorman wrote:

I have two word documents that I want to essentially merge.

They both contain merged data from the database and then I want to take the contents from one and merge it into the other.

Now whilst I can get the content across I can't seem to retain the formatting. Everything becomes Arial 10pt.

Any suggestions on how I can complete that last piece of the puzzle would be greatly appreciated.

Trial and error has about run its course.

TIA

Mark


At 28 JUL 2012 07:20PM bob carten wrote:

Try performing your process in word manually while running the macro recorder. Revew the macro it creates, that might tell you what you need to do.

- Bob


At 31 JUL 2012 02:54AM Martin Drenovac wrote:

Post removed by author


At 31 JUL 2012 03:01AM Mark Boorman wrote:

Thanks for the suggestion Bob and yes I've tried this.

I'm sure this must be a forest for the trees thing because I just can't get the copy and paste to work.

This is what the macro says:

Selection.WholeStory

Selection.Copy

Windows("Document2").Activate

Selection.PasteAndFormat (wdFormatOriginalFormatting)

and in OI

rv = OleCallMethod(oAppendMergeOut, 'Select') successfully selects the data I want but for all the variations of copy and paste calls I try, nothing ends up in the target document.

I can get the content into the target document via a direct assignment like this:

oDoc→Content = oAppendMergeOut→Content

but as in my first post, this brings the text only and no formatting.

I thought that by using copy/paste I might have more luck retaining the formatting but instead I can't get anything at all.

I don't really mind how I do it, I just want to get the formatted content from one doc into another.

TIA for any further suggestions.

Mark

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ce9397f500048050631dcee00.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1