none
Problem editing Word Footers with Interop RRS feed

  • Question

  • Hi, I'm trying to insert text to the left of a document's Footer, before editing the document.. it's footer would look like this (SINCE I CANT POST IMAGES), 

                              Text2                

                                                    Text3 

    Then i have a fucntion that collapses footers (Because i want to keep middle and right texts above, unedited) and adds some text aligned to the left side of the footer, problem is, the newly added text would be on top line, and i tried for 2 days with no luck, after running code to add Text1, it results in this: 

    Text1               Text2 

                                                   Text3

    what would i need to use to have Text1 in the same line as Text3 like so: 

                           Text2 

    Text1                                       Text3

    ```
    public void EditFooter(Word.Document doc)
    {
    foreach (Section section in doc.Sections)
    {
    Word.Range footerRange = section.Footers[Word.wdHeaderFooterIndex.wdHeaderFooterPrimary].Range;

    footerRange.Collapse(WdCollapseDirection.wdCollapseStart);
    footerRange.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphLEft;
    footerRange.Text = "Text1";
    }

    }
    ```

    I want the first text, (Text1) to be on the same line as the third text (from the image).


    Thursday, June 27, 2019 11:19 PM