To change margin now works, and margin (at least the content) within Footer/Header stays put. What I've done? No idea, I've done a lot though, but I think what did it was removing the Page Number from the DOCX (inside word) and then adding it again (inside word). "Suddenly", Page Number is not moving outside of the screen anymore. Page numbers (and other things) in the footer/header section should remain at the exact spot they were before changing the margin programmatically. These PlainTextContentControls are placed inside a table-cell. I've tried changing the right indent, without luck. How to move PlainTextContentControls that is not inside footer/header, but within the page, to stay inside the right-indent. How to re-add the Footer's PageNumber when user clicks my ToggleButton that changes left-indent? I've also noticed that PlainTextContentControl's moves out of the page, if they are near the right-edge when increasing the left-indent. But it does not move Page-Numbers back to its position. This moves PlainTextContentControls inside header/footer back to it its position, works If (isIntroductionSpeech = true) //If speech, left margin * 3ĭ = application.CentimetersToPoints(left) //Sets left-marginįoreach (Word.Section section in document.Sections) //Set footer section left-marginįoreach (Word.HeaderFooter headerfooter in section.Footers) Word.Document document = application.ActiveDocument I got to change that to dotx! :)Ĭode that is ran when inserting the margin private void IntroductionSpeechMargins(Word.Application application, bool isIntroductionSpeech, float lineSpacing, float left, float right) This is done in a Word-project through, building a template file, although the template file now has the extension. Basically you position cursor in footer and go to top Menu > Insert > Page Numbers >.