TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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]