Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Tables / November 2005

Tip: Looking for answers? Try searching our database.

exlcude tables in word count

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khilna - 29 Nov 2005 14:34 GMT
Hello

Does anyone know how I can run the word count tool in
Word 97 and get it to exclude the words in tables and inside brackets from
the total word count?

Many thanks for your help.

Khilna
Jezebel - 30 Nov 2005 08:36 GMT
Save the document. Delete all tables and text in brackets. Get your word
count. Close without saving.

> Hello
>
[quoted text clipped - 5 lines]
>
> Khilna
Greg - 30 Nov 2005 13:03 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.