'Replace' deletes hyperlinks

J

John

Hi there,

I have a block of code that runs through each paragraph in a slide and
replaces dash variants to a standard dash (Chr(45)). This works fine apart
from the fact that it deletes any hyperlinks (external) in the paragraph as
well.

Can anyone tell me a) why this is happening and b) what the solution might
be?

Many thanks

John



For Each txtPara In shp.TextFrame.TextRange.Paragraphs
'Replace en & em dashes with normal dashes
' Note em dash = Chr(151)
' and en dash = Chr(150)
' and normal dash = Chr(45)
txtPara = Replace(txtPara, " " & Chr(150) & " ", " "
& Chr(45) & " ")
txtPara = Replace(txtPara, " " & Chr(151) & " ", " "
& Chr(45) & " ")
Next txtPara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top