How to write Macro in Word?

G

Guest

I have a repetitive task on each title. I think it is better to write a Macro
for it and perform the macro over each title.
I have the Excel experience and I thought by selecting Macro, I will perform
steps inside word and word will automatically record them in Macro in
background. Apparently this excel procedure does not apply to word. Is there
any way to activate this procedure for Word as well? Otherwise it will be
very difficult for me to write the Macro from scratch in Word.Word 2003 SP2
 
G

Graham Mayor

Tools > Macro > Record New Macro will activate the macro recorder, but not
all functions are recordable. What is it that you wish to achieve?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

I want to do:
Alt o-p, remove a tik mark (Adjust characters to grid line when number of
lines are fixed in one page)
change the space for after paragraph to 0.5
closes the window.

I have many titles, which I want to apply above changes. So the ideal is
that I put curser in target line and hit the short cut key for my Macro and
it performs those two changes.
 
G

Graham Mayor

This sounds like changes to Japanese script which I cannot help you with,
however, couldn't you just create a paragraph style with the layout you
require and apply it as required?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

How do you know that I am working with Japanese scripts? Are that command
specially for Japanese scripts?
Yes you are right. I can define a style and apply. I wanted to learn VBA as
well. For VBA, I read Bill Coan article whish sounds simple and stright
forward but I don't know how to apply in diffenet locations (paragraphs)
 
R

Robert M. Franz (RMF)

Hi Koshravan
How do you know that I am working with Japanese scripts? Are that command
specially for Japanese scripts?

The "Adjust characters to grid line" is not something I've seen before,
I would've guessed some Asian language.

Yes you are right. I can define a style and apply. I wanted to learn VBA as
well. For VBA, I read Bill Coan article whish sounds simple and stright
forward but I don't know how to apply in diffenet locations (paragraphs)

If you intend to "walk" through the document manually and apply the
formatting, then a style seems really called for. You can then assign a
keyboard shortcut to it and no macro is needed.

If you can identify all paragraphs that are "headings" somewhat
formally, then you can use Find | Replace to search for them and apply
the style. You may or may not use a macro for that, too.

HTH
Robert
 
G

Graham Mayor

Khoshravan said:
How do you know that I am working with Japanese scripts? Are that
command specially for Japanese scripts?

The fact that you are an engineer from Osaka was a clue - as was adjusting
characters to grid line ;)
Yes you are right. I can define a style and apply. I wanted to learn
VBA as well. For VBA, I read Bill Coan article whish sounds simple
and stright forward but I don't know how to apply in diffenet
locations (paragraphs)

You dont really need a macro to apply a style - assign a keyboard shortcut
to the style. Put your cusror in the paragraph and hit the keyboard
shortcut. If you want to apply a style by macro (and correct for any manual
formatting) then you could use the following code:

Selection.Style = ActiveDocument.Styles("Heading 1")
Selection.Font.Reset

Select the text and run the macro:

See http://www.gmayor.com/installing_macro.htm
 
C

Charles Kenyon

Why not create and apply a style?
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Guest

Does this sort of questions encourages spammer's?
I didn't know that.
I just wanted to know the meaning "EnergyKey"
Will be happy if you could explain more
 
G

Guest

I downloaded it. A number "1" is beside its icon in sys tray in blue color.
How long can I use the trial version?
 
S

Suzanne S. Barnhill

You still are not getting it, are you? Did you not notice that this same
person had posted this same answer to dozens of different unrelated posts?
What you downloaded was very likely some sort of malware, and you'll get no
help on its use here because we wouldn't be crazy enough to try it. If there
are no instructions at the place where you downloaded it, you'd just SOL.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Do you think what I downloaded has virus?
What should I do now?
Is un-installing the software is enough?
Please guide. I am really frustrated.
 
G

Guest

Dear Suzanne

Thanks for your kind concern and reply. Otherwise I would never find out the
fact. Your contribution is highly appreciated. I owe a lot to your solutions,
comments and help. Also I learned a lot from Graham as well.
 
G

Guest

Dear Suzanne

Could you please kindly write what is the meaning of "SOL" abbrevation at
the end of your reply?
I haven't seen this abbrevation before.
 
S

Suzanne S. Barnhill

Well, you could expand it as "sorely out of luck." That would be more
polite. In truth, it stands for "sh*t out of luck."

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

You need to be very careful about downloading stuff from internet spammers.
It may or may not contain a virus or spyware. I don't know because there is
no way on earth that I would access such rubbish. Hopefully you are running
with up to date anti-virus protection (if not do so NOW!!!) which should
have picked up any viral contribution from the software, but some Word
macros can be malicious in effrect without being a virus, so until you know
what you are doing and what this software really is, consider it harmful and
avoid like the plague!


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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