Macros vs. Style

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the difference between a macro and a style? When is one superior to
the other?
 
Macros are a series of steps to be taken by Word. To some extent they mimic
keyboard and mouse input but are much more complex than that. See
http://word.mvps.org/FAQs/MacrosVBA.htm.

Styles are a method (the best method) of setting paragraph or character
formatting. See http://addbalance.com/usersguide/styles.htm and
http://addbalance.com/usersguide/basic_formatting.htm

They are very different concepts. You can use macros to set styles or
control formatting.
--

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

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
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.
 
A style is a collection of properties stored together as a unit, which
you can apply immediately to objects in your document. For example,
you can use table styles (Word 2002 and later) to quickly format
tables, you can use character styles to format the selected text, and
you can use paragraph styles to format paragraphs in Word. For more
information, see:

http://www.shaunakelly.com/word/styles/TipsOnStyles.html.

Macros use the programming language known as VBA (Visual Basics for
Applications) to perform different tasks. For more, see:

http://word.mvps.org/FAQs/MacrosVBA/index.htm.
 
In addition to the great advice offered, I will add this:

Macros require your security setting to be set at a level that will allow
them to run (preferably "Medium"). As such, some folks/companies get
nervous about running macros. Even though I can create a macro that can
change a variety of formatting features of a word or paragraph, I will NEVER
create a macro to do anything that can already be done using Word's built-in
tools.
 
Basically everything or at least a whole lot :-).

A macro is a named sequence of statements executed as a unit. For
example the I use the following AutoOpen macro to ensure that every
document I open in Word opens in the view that I want and with several
annoying toolbars turned off:

Sub AutoOpen()

ActiveWindow.Caption = ActiveDocument.FullName
With ActiveWindow.View
..Type = wdPrintView
..Zoom.PageFit = wdPageFitBestFit
..FieldShading = wdFieldShadingAlways
End With
With CommandBars
..Item("Reviewing").Visible = False
..Item("Mail Merge").Visible = False
..Item("Forms").Visible = False
End With
End Sub

In Microsoft Word, a style is a collection of formatting instructions.
You might apply the builtin "Title" style to title all of your papers
with Arial 16PT font centerd between the margins. See:
http://www.shaunakelly.com/word/styles/TipsOnStyles.html

You can apply a style with a macro e.g.,

Sub ApplyBodyTextStyleToSelection()

Selection.Range.Style = wdStyleBodyText
End Sub

You can't apply a macro with a style.
 
Back
Top