Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Shyla
 
Posts: n/a
Default Help needed for Micrsoft Word Macro

Hi,

I am trying to get the word count for the inserted text using Track
changes as "ON" in the word document.

The text on the document i have added is "Hello world".
When i am trying to get the count on macro then it is showing 1, but i
have inserted two words.

Please help me if you know how to get the count for the inserted text.

My code is like this
**********************************
Dim mySection As Section
Dim iCount As Integer

For Each mySection In ActiveDocument.Sections
iCount = iCount + mySection.Range.Revisions.Count
Next
MsgBox "Count is " & iCount
**********************************

Thanks
Shyla

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod
 
Posts: n/a
Default Help needed for Micrsoft Word Macro

Hi Shyla

I'm not sure whether you just want the total number of revisions, the number
of words in each revision, or the number of words in all revisions. The
following code does all three, though you need to be aware that Word treats
punctuation marks as words in their own right:

Sub ListRevisionChanges()
Dim Rev As Revision
Dim RWrd As Integer
RWrd = 0
MsgBox "# Revisions: " & ActiveDocument.Revisions.Count
For Each Rev In ActiveDocument.Revisions
MsgBox "Revision Text: " & Rev.Range.Text & vbCrLf & _
"Revision Words: " & Rev.Range.Words.Count
RWrd = RWrd + Rev.Range.Words.Count
Next
MsgBox "# Revision Words: " & RWrd
End Sub

Cheers


"Shyla" wrote in message
oups.com...
Hi,

I am trying to get the word count for the inserted text using Track
changes as "ON" in the word document.

The text on the document i have added is "Hello world".
When i am trying to get the count on macro then it is showing 1, but i
have inserted two words.

Please help me if you know how to get the count for the inserted text.

My code is like this
**********************************
Dim mySection As Section
Dim iCount As Integer

For Each mySection In ActiveDocument.Sections
iCount = iCount + mySection.Range.Revisions.Count
Next
MsgBox "Count is " & iCount
**********************************

Thanks
Shyla



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get rid of page numbers. The page number virus flamestar Microsoft Word Help 3 August 19th 05 02:31 AM
apply a template to existing documents Bubba Gump Shrimp Page Layout 2 July 28th 05 04:46 PM
Does Word have Keyboard Merges like Word Perfect does? Donnas Mailmerge 1 June 28th 05 09:30 PM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM
In Word, how can I see all files (*.*) in "save as"? citizen53 New Users 8 April 4th 05 04:56 PM


All times are GMT +1. The time now is 02:29 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"