locked
wdFormatOriginalFormatting not preserving formatting when pasting rtf text in Word 2010 RRS feed

  • Question

  • I have a VB script that uses the method PasteandFormat that do not seem to preserve theoriginal formatting after upgrading to Office 2010.  Here is the sample code

            wdApp.Selection.WholeStory
            wdApp.Selection.Copy
            wdApp.ActiveWindow.Close savechanges:=wdDoNotSaveChanges
            destdoc.Activate
            wdApp.Selection.PasteAndFormat (wdFormatOriginalFormatting)
            wdApp.Selection.InsertBreak Type:=wdSectionBreakNextPage

    We have been using li360 to indent data within an rtf table.  (See second row in example below) and this indentation is getting lost after our upgrade.  This used to work in Word 2003.  Any ideas?

    {\row}
    \trowd\trkeep\trqc\trgaph30
    \cltxlrtb\clvertalt\clcbpat8\cellx6485
    \cltxlrtb\clvertalt\clcbpat8\cellx8045
    \cltxlrtb\clvertalt\clcbpat8\cellx9605
    \cltxlrtb\clvertalt\clcbpat8\cellx11170
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{Blood and lymphatic system disorders\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 52 (28)\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 70 (27)\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 18 (-1)\cell}
    {\row}
    \trowd\trkeep\trqc\trgaph30
    \cltxlrtb\clvertalt\clcbpat8\cellx6485
    \cltxlrtb\clvertalt\clcbpat8\cellx8045
    \cltxlrtb\clvertalt\clcbpat8\cellx9605
    \cltxlrtb\clvertalt\clcbpat8\cellx11170
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\li360 Anaemia\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 10 (5)\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 15 (6)\cell}
    \pard\plain\intbl\sb30\sa30\ql\f1\fs20\cf1{\qj\tqdec\tx350 5 (1)\cell}
    {\row}


    • Edited by Tom_23 Thursday, April 12, 2012 11:58 PM
    Thursday, April 12, 2012 11:57 PM

All replies