title: Editing Hyperlinks(x).texttodisplay moves hyperlink to beginning of text box in PowerPoint
body: <p>I'm having problems with VBA in PowerPoint - when I try to edit the TextToDisplay property of a hyperlink, it edits the text, but moves the hyperlink location to the beginning of the text box.</p>
  
  <p><img src="https://i.stack.imgur.com/DDMjX.png" alt="broken hyperlinks"></p>
  
  <p>On the first pass, I get the first characters of the text box changed into the link, then on the second pass, that link gets rewritten.</p>
  
  <p>I'm using the following code to update the page numbers of hyperlinks when slides get moved around.</p>
  
  <pre><code>Sub UpdatePageNumbers()
  
  For Each sld In ActivePresentation.Slides
      For x = CInt(sld.Hyperlinks.Count) To 1 Step -1
          strParts = Split(sld.Hyperlinks(x).SubAddress, ",")
          PageNumber = ActivePresentation.Slides.FindBySlideID(CInt(strParts(0))).SlideNumber
          sld.Hyperlinks(x).TextToDisplay = "Page " &amp; PageNumber
      Next
  Next
  
  End Sub
  </code></pre>
  
  <p>Has anyone seen this before/come up with a solution? Had a search and couldn't find anything.</p>