Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript Word, Character Count does not match ...

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,934
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript Word, Character Count does not match ...
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript Word, Character Count does not match ... - 12/21/2003 8:59:54 AM   
  iges

 

Posts: 1
Score: 0
Joined: 12/21/2003
From:
Status: offline
Hi,

I have a VBScript code posted below to get the content of MS Word
doc,rtf files. The problem is when I count the words, characters (no spaces), characters (with spaces) the result does not match the MS Word Word Count called from the Tools menu. I figured this is beacuase of design elements (tables, images etc) that use special characters included in the content.

Is there a way to get only pure plain text without special characters out of the word document or perhaps somehow to access the Word Count feature in Tools menu?

regards,
iges.

Function ReadMSDocContent(pFullPath, pFilename)
Dim objWord, docRange

Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.Open(pFullPath)
Set docRange = objWord.Documents(pFilename).Content
ReadMSDocContent = docRange.Text
objWord.Application.Quit True
End Function
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript Word, Character Count does not match ... Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts