title: Editing anchor position in header of Microsoft Word using vba
body: <p>I am working on a VBA macro, which I wrote only parts of it myself, for MS-Word that changes the orientation of the page and then copies the header and footer of previous pages to the new page and some other stuff:</p>
  
  <pre><code>Selection.PageSetup.Orientation = wdOrientLandscape
  ActiveDocument.Sections.Last.PageSetup.DifferentFirstPageHeaderFooter = False
  
  ActiveDocument.Sections(ActiveDocument.Sections.Last.index - 1).Headers(wdHeaderFooterPrimary).Range.Select
  Selection.Copy
  
  ActiveDocument.Sections.Last.Headers(wdHeaderFooterPrimary).Range.Select
  Selection.Paste
  
  ActiveDocument.Sections.Last.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
  ActiveDocument.Sections.Last.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
  
  formatHeader wdHeaderFooterPrimary
  formatHeader wdHeaderFooterFirstPage
  </code></pre>
  
  <p>There is a text in a TextBox which is anchored to header. What I want to do now is to change its position on the pages with "Landscape" orientation.</p>
  
  <p>How can I change the layout options (see images below)? I haven't been able to find any information.</p>
  
  <p>This is how my document looks like after changing the page orientation to "Landscape":
  <a href="https://i.stack.imgur.com/CA62z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CA62z.png" alt=""></a></p>
  
  <p>As you see, the paragraph on the side, in the TextBox is not in the middle. so I want to move it a bit higher. You can also see the anchor in this image.
  <a href="https://i.stack.imgur.com/tLfpm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tLfpm.png" alt=""></a></p>
  
  <p>This is how I did it in Word as a user:</p>
  
  <p><a href="https://i.stack.imgur.com/pPFB4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pPFB4.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/1oMHb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1oMHb.png" alt="enter image description here"></a></p>