Re: Automating collection of styles/styles in use in Word document

Subject: Re: Automating collection of styles/styles in use in Word document
From: Geoff Lane <geoff -at- GJCTECH -dot- FORCE9 -dot- NET>
Date: Wed, 16 Jun 1999 09:52:12 +0100

Kim,

Assuming that you're using Word 97, the following macro should do the trick:

Sub ListStyles()
Dim StyleName As String
Dim CurDoc As Document
Dim i As Integer

Set CurDoc = ActiveDocument

Documents.Add
For i = 1 To CurDoc.Styles.Count
With CurDoc.Range.Find
.Style = CurDoc.Styles(i).NameLocal
If .Execute("") Then
Selection.TypeText "* " & CurDoc.Styles(i).NameLocal &
Chr(13)
Else
Selection.TypeText " " & CurDoc.Styles(i).NameLocal &
Chr(13)
End If
End With
Next
Set CurDoc = Nothing
End Sub

It creates a new document that lists all the styles in the current document,
and marks those in use with an asterisk.

HTH,

Geoff Lane
Cornwall, UK
geoff -at- gjctech -dot- force9 -dot- net

-----Original Message-----
From: Kim Young
Subject: Automating collection of styles/styles in use in Word document


I've searched the archives and have not found anything pertaining to this
subject....

Does anyone know if there is a way to automatically retrieve a list of
styles defined in a document (not in the attached template), and show which
styles in this list are currently in use in the document?
[rest snipped]

From ??? -at- ??? Sun Jan 00 00:00:00 0000=




Previous by Author: Re: CorelDraw Q
Next by Author: Re: PaintShop Pro5 vs. Photoshop???
Previous by Thread: Automating collection of styles/styles in use in Word document
Next by Thread: PostScript Versions


What this post helpful? Share it with friends and colleagues:


Sponsored Ads