International Translation Day 2018

Join ProZ.com/TV for a FREE event September 25-26th celebrating International Translation Day! 50+ hours of content, Chat, Live Q&A & more. Join 1,000's of linguists from around the globe as ProZ.com/TV celebrates International Translation Day.

Click for Full Participation

Macro for replacing colors in Word 97 (VB)
Thread poster: Cecilia Falk

Cecilia Falk  Identity Verified
Local time: 13:36
English to Swedish
Jan 21, 2005

Hello,
I often use colors when manipulating my translations in order to mark out
various things (text not to be spellchecked, etc) so I often have to search
and replace colors.
In order to skip all the steps in the Search and Replace dialog evertime I
want to do this I am now trying to write a macro which is basically a
dialogbox with two sets of option buttons for all the colors and what I
would like to happen is that you for example check the option button for
"Blue" in the first set and the the option button for "Green" in the second
set and then click OK in order to replace all Blue text with Green.
I am only an amateur when it comes to macros and I am stuck at what code to
write for the Command button "OK" to make this happen. Does anybody have a
quick tips, an URL or something. I have been reading my hanbbok for VBA,
but can't find anything there or in the help that I understand;-)
Or maybe there is an even easier way to accomplish this?

Best regards,
Cecilia


[Edited at 2005-01-21 00:19]


 

Jaroslaw Michalak  Identity Verified
Poland
Local time: 13:36
Member (2004)
English to Polish
Let's try this... Jan 21, 2005

I didn't test it yet, as it would requiring preparing the dialog form etc., but the following set of instructions should work:

With ActiveDocument.Content.Find
.ClearFormatting
.Font.ColorIndex = Color1
.Text = ""
With .Replacement
.ClearFormatting
.Font.ColorIndex = Color2
.Text = ""
End With
.Execute Format:=True, Replace:=wdReplaceAll
End With

Color1 and Color2 are the values set by the appropriate dialog box items. The instruction replaces the colors only in the main text (story). For headers, footers etc. this would require a loop.

This is for Word 2000, but I think it should work the same as for Word 97.

Some time later I might write the whole procedure, but I guess you would prefer finishing it yourself, it's much more fun! And the knowledge you get will help you more useful macros.

[Edited at 2005-01-21 02:24]


 

Cecilia Falk  Identity Verified
Local time: 13:36
English to Swedish
TOPIC STARTER
Thank you! Jan 24, 2005

I recieved some other suggestions also from other sources, so my next step will be to try them all to see which one I get to work
icon_wink.gif
Thanks again, it is great to be able to ask questions like this when you are completely stuck!

Best regards,
Cecilia


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Macro for replacing colors in Word 97 (VB)

Advanced search






CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search