by Allen Wyatt
(last updated January 4, 2014)
Word allows you to use styles to format both paragraphs and individual characters in your document. These styles can greatly simply the consistent application of formatting across an entire document. If you are writing a VBA macro, you may have a need to determine the name of the style applied to a particular paragraph. You can do that by using the Style property with a Paragraph object, as follows:
sParStyle = ActiveDocument.Paragraphs(J).Style
When this line is executed, sParStyle (a string variable) will contain the name of the style used on the specified paragraph.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (824) applies to Microsoft Word 97, 2000, 2002, and 2003.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
When using a macro to process text in a document, it is not unusual to replace one portion of a text string with another ...Discover More
Word allows users to conveniently work with multiple documents at the same time. When writing macros, you may need to know ...Discover More
Do you want to easily jump to the top of a page in your document? You can use the Go To command to make the shift, or you can ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.