Link to home
Start Free TrialLog in
Avatar of dickep
dickep

asked on

How to save bookmark formatting in VBA

I have a macro that saves the range of a bookmark, but I want to keep the formatting of the text in the bookmark also.  How can I do that?

Here is some code I use:

Set Rng1 = ActiveDocument.Bookmarks("SerialNumber").Range

    Rng1.Delete
    Rng1.Text = SerialNumber

SO, you can see that I am trying replace the SerialNumber in the range.  I have formatted the bookmark, but it appears that also gets deleted and the default formatting is used.

Thanks
Ep
ASKER CERTIFIED SOLUTION
Avatar of Glenn_Moore
Glenn_Moore

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial