Reply
 
Thread Tools Display Modes
  #1   Report Post  
Jihrke
 
Posts: n/a
Default Selecting Text in Macro


I am trying to create a macro that will allow me to select all blue text
in a document and convert to hidden blue text.

Any help would be greatly appreciated.


--
Jihrke
  #2   Report Post  
atropus32
 
Posts: n/a
Default


Jihrke Wrote:
I am trying to create a macro that will allow me to select all blue text
in a document and convert to hidden blue text.

Any help would be greatly appreciated.


If you switch on the macro recorder and use the search/replace facility
and use the "More" "Format" to choose the relevant color and the same
approach to select the replacement value of hidden text then I think it
will provide what's required.

I tried it and it seems to work fine.


--
atropus32
  #3   Report Post  
Jihrke
 
Posts: n/a
Default


atropus32 Wrote:
If you switch on the macro recorder and use the search/replace facility
and use the "More" "Format" to choose the relevant color and the same
approach to select the replacement value of hidden text then I think it
will provide what's required.

I tried it and it seems to work fine.


I have tried what you suggested, it seems like everything works when I
record the macro but when I try to execute it, nothing happens. Here
is the macro that it creates, I dont see where it tells it to replace
the text as hidden...

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Thanks again for your help.


--
Jihrke
  #4   Report Post  
Jihrke
 
Posts: n/a
Default


For anyone who runs across the same problem in the future, I did find an
article that explains what was happening, the macro recorder doesnt
include the code to change the font. After manually adding the lines
of code to change the font, this is the final product....

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Font.Color = wdColorBlue
.Replacement.Font.Hidden = True
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


--
Jihrke
  #5   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

For the benefit of others having similar problems, I imagine the article you
found was http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Jihrke" wrote in message
...

For anyone who runs across the same problem in the future, I did find an
article that explains what was happening, the macro recorder doesnt
include the code to change the font. After manually adding the lines
of code to change the font, this is the final product....

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
Text = ""
Replacement.Text = ""
Font.Color = wdColorBlue
Replacement.Font.Hidden = True
Forward = True
Wrap = wdFindContinue
Format = True
MatchCase = False
MatchWholeWord = False
MatchWildcards = False
MatchSoundsLike = False
MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


--
Jihrke


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
selecting multiple lines of text Mary52404 Microsoft Word Help 6 August 11th 05 08:26 PM
How can I stop Word "selecting" text Steve Hayes New Users 3 July 31st 05 06:38 AM
Use macro to find in text box Adrian Microsoft Word Help 3 July 18th 05 03:28 PM
End/FootNote text style Shaun Page Layout 4 July 5th 05 04:36 PM
Can autocomplete insert unformatted text into a document? Daiya Mitchell Microsoft Word Help 1 February 22nd 05 02:23 PM


All times are GMT +1. The time now is 06:24 PM.

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"