• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

ASP Code Needed for counting numbers of pages in MS-Word file and no. of words in the document.

Hi All,

  I m in urgent need of a asp code for counting the total no. of  pages in a word file, and the word count.

I am trying this code -

Dim objWord
Dim objDoc
Set objWord = Server.CreateObject ("Word.Application")
Set objDoc = objWord.Documents.Open (Server.MapPath(("c:\WordABC.doc")))
wc = objWord.Documents.wordcount

response.write objDoc.readall
response.end
objDoc.Save
Set oWDoc = Nothing
Set oWord = Nothing

But getting following error -
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed

  Please help.
0
Subrojit
Asked:
Subrojit
1 Solution
 
TDSnetCommented:
Do you have Word installed on the web server..?  It sounds like your application can't find the Object Library.  Also, Microsoft recommend you use "CreateObject" instead of "Server.CreateObject" when automating Office objects from an ASP page.

http://support.microsoft.com/?id=828550

Cheers,
Jack
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now