brettdoyle
07-16-2015, 06:24 AM
I have some code that is similar to below:
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
If .Range.text <> vbCr Then
.Range.text = Replace(.Range.text,"Old text","New text")
End If
End With
It works and replaces the text that I want... but the problem is I lose everything besides the text in the header. For instance, there is a horizontal line and an image in the logo that disappear as soon as the .text property is changed.
Is there a different way to change the text while retaining images?
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
If .Range.text <> vbCr Then
.Range.text = Replace(.Range.text,"Old text","New text")
End If
End With
It works and replaces the text that I want... but the problem is I lose everything besides the text in the header. For instance, there is a horizontal line and an image in the logo that disappear as soon as the .text property is changed.
Is there a different way to change the text while retaining images?