vba problem word 97 and not word 2000 
Author Message
 vba problem word 97 and not word 2000

Hello,

I use this to count the amount of characters in a word document.
The strange thing is, sometimes the result is not correct, even negative
numbers
This appears in word97 SR2 and not anymore in word2000.
Does anyone now if that was a bug,
and if it was a bug, is there a patch or something to solve that bug.

  StatusBar = "Counting..."
  System.Cursor = wdCursorWait
  a = myrange.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)
& " chars"
  MsgBox
myrange.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)

Many Thanks,
Frank Scheldeman.




Mon, 16 Aug 2004 16:51:43 GMT  
 vba problem word 97 and not word 2000
Hi Frank

It looks to me like you have got some parts of the longer lines of code
mixed up.

Try this.

  StatusBar = "Counting..."
  System.Cursor = wdCursorWait
  a = myrange.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)
  MsgBox a & " chars"

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Hello,

> I use this to count the amount of characters in a word document.
> The strange thing is, sometimes the result is not correct, even negative
> numbers
> This appears in word97 SR2 and not anymore in word2000.
> Does anyone now if that was a bug,
> and if it was a bug, is there a patch or something to solve that bug.

>   StatusBar = "Counting..."
>   System.Cursor = wdCursorWait
>   a =

myrange.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)
Quote:
> & " chars"
>   MsgBox
> myrange.ComputeStatistics(Statistic:=wdStatisticCharactersWithSpaces)

> Many Thanks,
> Frank Scheldeman.





Mon, 16 Aug 2004 17:39:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Differences between VBA for Word 2000 and Word 97

2. Word 97 and Word 2000 VBA - Functionality Lost?

3. Passing Userforms to subs (Word 2000 and 2002, I did not try Word 97)

4. Why does this piece of code work with Word 97 but not Word 2000

5. Word 97 --> Word 2000 problem

6. Convert Word 97 WordBasic to Word 2000 VB code

7. My Word 97 macros don't run in Word 2000

8. Diffs Between Word 2000 and Word 97?

9. Word 2000 and Word 97

10. Word 97 & Word 2000

11. display under Word 97 & Word 2000

12. Word 2000 and Word 97 -- how to?

 

 
Powered by phpBB® Forum Software