![]() ![]() Still, there is the difference at the page break - the paragraph mark is places on the new page, instead on the same page.Īlso, the text is slightly larger, even though the Font Size is the same. #How to keep source formatting in word 2003 code#docx format, this is why I think I am stuck with COM Interop.īased on Macropod code posted by Charles Kenyon, I have managed to copy more of the formatting from the source to target. I am open to another suggestion regarding this topic, but I know that. How do I handle these issues? Both the documents are based on Normal template. I have also tried adding the VBA modules to the document, but there are also Document Variables and other custom properties and I don't want to mess with the file being uploaded to the server. I have also tried using Range.Insert() method and setting the range without copying as described here, but I am still having these issues. The page format is also messed up, the output having mirror margins set up. However, the tables are messed up.Īlso, if there is a Page Break, the output is different.Īlso, at the end of the document a paragraph mark is added, as follows: Word.Application objWordOpen = new Word.Application() ĭocument doclocal = (tempsave) ĭocument d1 = (savelocation) ĭ1.() String savelocation = //location of existing document ![]() Having these limitations in mind, I first created the following method: string tempsave = //location of user created document The document generated by the webserver (existing document) is a Word 2003 document, but the document created by the user is either a Word 2003 document or Word 2007+. This is because the existing document is a document that is generated from a webserver and has VBA modules for uploading it back to the server. I cannot simply copy the file using System.IO or saving a copy of the document created by the user using SaveAs methods in Word Interop. The existing document content must be an exact mirror to the document created by the user. I want to copy the content of a document created by the user to an existing document. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |