Need help writing a Macro.

P

prinkster

Hey everyone, I was hoping someone could help me with a Word macro.
Basically, I want to select an area of text, and convert every
character that is NOT Heading 3 style to a different style. I get the
feeling this is not very complicated but I don't really know where to
start. Thanks!
 
J

John McGhie

Welcome! You have embarked upon your first "Programming" task on a computer
:)

OK, as a professional programmer (which you are just about to become...) you
would know that the first thing you need to do is to specify your
"environment". In this case, that means the version and level numbers of
your Word program and your operating system.

The compiler needs to know these things in order to translate your
instructions into the correct code. And you need to know these things so
you write a program that your target computer can run.

And WE need to know these things so we can tell you how to begin :)

However, in your case, you do not "actually" need to write a program to do
this: Microsoft has already done this for you.

This function is built-in to the Word Find/Replace dialog.

Doing the "NOT" is a bit tricky ‹ you need to get a little devious...

First, Search for everything that IS Heading 3, and set its font to
"Hidden".

Now, set Word to NOT display hidden text.

Now, SELECT everything that is visible and apply your new style.

Now, turn your display of Hidden back on.

Now Search for Heading 3 + Hidden and set it to "Not Hidden".

I think you'll be OK from there: I you need a little more detail, get back
to us.

Cheers


Hey everyone, I was hoping someone could help me with a Word macro.
Basically, I want to select an area of text, and convert every
character that is NOT Heading 3 style to a different style. I get the
feeling this is not very complicated but I don't really know where to
start. Thanks!

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top