VB 6.0 - Add thousands Separator in VB Message Box

alfred van cleef posted at 01-Nov-08 06:59

Hi all,

I am a Dutch, professional literary writer and I created a macro that helps me to count the words and pages of the book I am currently writing. For various reasons I chose not to use the regular built-in word counting tool for this goal. I use Windows XP, Word 2003 and VB 6.3. I wrote a macro, in which I would like the words and pages to be displayed with a (European) thousands separator in a Message Box. Now it will read in my Message Box: Words: 13456 or 123456 and I want it to read 13.456 or 123.456.

My regional settings are Dutch. The normal built-in word counting option in the Tools menu of Word 2003 does work well: it uses the regular European thousands separator and will read 13.456 for 13456 or 123.456 for 123456, but my message box numbers won't. Is there a way to change this behaviour? I tried the FontNumbers option, but without success.

Here is my macro (I changed Dutch into English or 'My Text'):

Sub CountWords()

MsgBox "Pages:  " & Selection.Information(wdNumberOfPagesInDocument) & vbCrLf _

& "Words: " & ActiveDocument.Range.ComputeStatistics(wdStatisticWords) _

& vbCrLf & vbCrLf & "My Text", vbOKOnly, "My Text"

End Sub

 

Thanks in advance,

Alfred

PS I am not an expert in programming at all, so I would prefer to just get some lines of code I could add to the above macro that will force the counted pages and words to use a thousands separator


Click here to sign in and reply. You could earn money via our message board contest just for being helpful.
  Add thousands Separator in VB Message Box - alfred van cleef  01-Nov-08 06:59 6:59:19 PM
      Add thousands Separator in VB Message Box - Jack Shah  02-Nov-08 12:46 12:46:39 AM
          counting words and pages with thousands separator - alfred van cleef  02-Nov-08 11:53 11:53:21 AM
              reply - Jack Shah  02-Nov-08 10:48 10:48:09 PM
                  Thanks + Save document that does not have focus - alfred van cleef  03-Nov-08 10:24 10:24:04 AM
      try this example - C_A P  03-Nov-08 09:47 9:47:34 AM
          Problem solved but thanks! - alfred van cleef  03-Nov-08 10:28 10:28:35 AM
View Posts

  

Search

search



Purchase