0

I'm trying to create a VBA Macro in Word that will search for some text and apply a specific style to it. Before I automate it I'm trying to do it manually via the Find and Replace tool. Here's what I'm doing...

  1. Open a word document with the text: This is the first sentence in the word document.
  2. Make the phrase "in the" to be bold.
  3. Open up the Find and Replace Tool via Edit --> Replace.
  4. In the "Find what:" field only have Format: Font:Bold
  5. In the "Replace with:" field only have Format: Style:Heading 1
  6. Click on "Replace All"

Notice how the entire sentence has been changed to "Heading 1". I only wanted the areas in the document that were "bold" to be in "Heading 1" not the whole sentence.

What am I doing wrong?

3
  • 1
    Did you already try Italic format? Without testing it myself I'd guess your result is due to the fact that Heading 1 is paragraph format. Commented Feb 17, 2012 at 11:39
  • What does it mean "paragraph format"? Does this work differently? Commented Feb 17, 2012 at 18:34
  • 1
    Paragraph means that - as you have seen - will format everything from the beginning of the line to the next line break (in your case the whole sentence). Commented Feb 17, 2012 at 22:01

1 Answer 1

1

A Heading is a heading.

If you change any part of the sentence to Heading1 the whole sentence becomes the heading. If you want it to be bigger, my suggestion would be to increase the font size not make it a Heading!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.