Macros vs. Style

P

PreciousIvy

What is the difference between a macro and a style? When is one superior to
the other?
 
C

Charles Kenyon

S

Stefan Blom

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.
 
B

Bill Foley

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.
 
G

Greg

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.
 

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