View Single Post
  #3   Report Post  
Posted to microsoft.public.word.tables
Greg
 
Posts: n/a
Default exlcude tables in word count

For automating Jezebels suggestions you might use something like:

Sub ScratchMacro()
Dim myString As String
Dim oStoryRng As Word.Range
Dim i As Long

myString = ActiveDocument.FullName
ActiveDocument.Close wdSaveChanges
Documents.Open FileName:=myString
For i = ActiveDocument.Tables.Count To 1 Step -1
ActiveDocument.Tables(i).Delete
Next
For Each oStoryRng In ActiveDocument.StoryRanges
Do Until (oStoryRng Is Nothing)
With oStoryRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\{*\}"
.Replacement.Text = ""
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Set oStoryRng = oStoryRng.NextStoryRange
Loop
Next
MsgBox ActiveDocument.ComputeStatistics(wdStatisticWords)
ActiveDocument.Close wdDoNotSaveChanges
Documents.Open FileName:=myString
End Sub