none
Intrope Word RRS feed

  • Question

  • Hello Guys,

    Please help here,

    I want to add blank page end of word document using intrope c#.

    if anyone have suggestions, please reply here

    Thanks in advance


    Wednesday, March 11, 2020 11:54 AM

Answers

  • Hi Hasim Marfatiya,

    I make a test based on your description, and you can refer to the following code to add blank page end of word document.

                using Word = Microsoft.Office.Interop.Word;
    
    
                var word = new Word.Application();
                var doc = word.Documents.Open(@"your path");
                object what = Word.WdGoToItem.wdGoToPercent;
                object which = Word.WdGoToDirection.wdGoToLast;
                object missing = Missing.Value;
                word.Selection.GoTo(what, which, missing, missing);
                word.Selection.InsertNewPage();
                doc.Save();
                doc.Close();
                word.Quit();

    Hope it can help you.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 12, 2020 3:32 AM
    Moderator

All replies

  • Hi Hasim Marfatiya,

    I make a test based on your description, and you can refer to the following code to add blank page end of word document.

                using Word = Microsoft.Office.Interop.Word;
    
    
                var word = new Word.Application();
                var doc = word.Documents.Open(@"your path");
                object what = Word.WdGoToItem.wdGoToPercent;
                object which = Word.WdGoToDirection.wdGoToLast;
                object missing = Missing.Value;
                word.Selection.GoTo(what, which, missing, missing);
                word.Selection.InsertNewPage();
                doc.Save();
                doc.Close();
                word.Quit();

    Hope it can help you.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 12, 2020 3:32 AM
    Moderator
  • Thank You very much for your reply

    it's working

    Friday, March 13, 2020 5:37 AM