Taiseer Hussein

Taiseer Hussein

  • NA
  • 3
  • 4.8k

How to restart list numbering in copy and paste when merging two or more word doc in single one Using C#

Jan 3 2012 11:34 AM
Hi,
 I have a C# project to combine multiple word doc in single one. I was able to combine them successfully using copy & paste or Selection.InsertFile, however I'm having two issues
1. I wanted to keep the original format for each doc, therefore I'm using oWordApplication.Selection.PasteAndFormat(Microsoft.Office.Interop.Word. WdRecoveryType .wdFormatOriginalFormatting); which keeps the original formatting.
2. The second issue is the list numbering in which it continues from the previous inserted doc. I can use oWordApplication.Selection.PasteAndFormat(Microsoft.Office.Interop.Word. WdRecoveryType .wdListRestartNumbering), but in this case I can't use the wdFormatOriginalFormatting where I lose the original formating.
Is there a way I can use both (wdFormatOriginalFormatting and wdListRestartNumbering) in single paste, so I can keep the original formatting for each doc and rest the numbering from the beginning? Or is there a way to restart the numbering after I paste with original formatting.
 
Thanks

Answers (2)