Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Sep 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro Help: Losing formatting with replace()

    I'm having a little trouble retaining formatting when replacing some text in a Word text box.

    When I use this line I lose all the individual character formatting for the text range.

    Box.TextFrame.TextRange = Replace(Box.TextFrame.TextRange.Text, "replace this text, "with this text")

    Box.TextFrame.TextRange is a text box that has been formatted character by character. Picking up attributes like bold, italic, size, font, etc. from a text box inside CorelDraw. After all this is done certain words within the textbox have to be replaced. Is there another way to do this?

    Thanks for any help.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Cross-posted (and answered) at: http://www.mrexcel.com/forum/general...ce-msword.html
    For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •