Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] swebber27@yahoo.com is offline
external usenet poster
 
Posts: 2
Default macro for highlighting text formatting

Hi,

I'm trying to create a macro that will automatically highlight specific
text formatting, like ital, bold, etc. I find that I can get it to work
when I enter something into the text field, but when I leave that field
blank (which is what I want, because I want it to highlight all
instances of italic) the macro will not work.

Can anyone help, or do you know of a macro for this?

thanks, SMW

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default macro for highlighting text formatting

The macro recorder has a bug that prevents it from recording your formatting
selections in the Find dialog. You'll have to fix it by hand. See
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm, in the section
"Fixing broken Replace macros".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


wrote:
Hi,

I'm trying to create a macro that will automatically highlight
specific text formatting, like ital, bold, etc. I find that I can get
it to work when I enter something into the text field, but when I
leave that field blank (which is what I want, because I want it to
highlight all instances of italic) the macro will not work.

Can anyone help, or do you know of a macro for this?

thanks, SMW



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] swebber27@yahoo.com is offline
external usenet poster
 
Posts: 2
Default macro for highlighting text formatting

Jay,

Thanks for the help. What code should I enter in the VBA editor to tell
it to highlight text?

SMW

Jay Freedman wrote:
The macro recorder has a bug that prevents it from recording your formatting
selections in the Find dialog. You'll have to fix it by hand. See
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm, in the section
"Fixing broken Replace macros".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


wrote:
Hi,

I'm trying to create a macro that will automatically highlight
specific text formatting, like ital, bold, etc. I find that I can get
it to work when I enter something into the text field, but when I
leave that field blank (which is what I want, because I want it to
highlight all instances of italic) the macro will not work.

Can anyone help, or do you know of a macro for this?

thanks, SMW


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default macro for highlighting text formatting

To have it highlight all italic text, take the entire macro called Macro4A()
from the article I mentioned, and change the line

.Replacement.Font.Bold = True

to

.Replacement.Highlight = True

If you want to look for some other formatting, change the .Font.Italic line,
for example,

.Font.Bold = True

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

wrote:
Jay,

Thanks for the help. What code should I enter in the VBA editor to
tell it to highlight text?

SMW

Jay Freedman wrote:
The macro recorder has a bug that prevents it from recording your
formatting selections in the Find dialog. You'll have to fix it by
hand. See
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm, in the
section "Fixing broken Replace macros".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.


wrote:
Hi,

I'm trying to create a macro that will automatically highlight
specific text formatting, like ital, bold, etc. I find that I can
get it to work when I enter something into the text field, but when
I leave that field blank (which is what I want, because I want it to
highlight all instances of italic) the macro will not work.

Can anyone help, or do you know of a macro for this?

thanks, SMW



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
manipulating/cutting/pasting text out of a text box [email protected] Microsoft Word Help 10 July 9th 06 10:54 PM
autoshape text wrapping cayce Page Layout 6 June 16th 06 09:42 PM
Macro Text on Command Button gone in email SueKuKu Microsoft Word Help 3 May 8th 06 11:55 PM
Word applies direct format on File open Uriel Microsoft Word Help 16 November 27th 05 07:22 PM
Outline Renee Hendershott Page Layout 2 December 25th 04 02:49 PM


All times are GMT +1. The time now is 08:27 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"