Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: asp_web_howto digest: January 28, 2002


Message #1 by psinghp@e... on Tue, 29 Jan 2002 10:29:51 +0400
> Subject: Re: What is wrong with this code

> From: "Chadwick DeVoss" <chad@d...>

> Date: Mon, 28 Jan 2002 16:15:47

> X-Message-Number: 18

>

> maybe try the GetObject method

>

> Set objWord = GetObject("c:\temp\r.doc", "Word.Application")

>

>



Thanks. I will try this. However, I understand that get method is used if instance of the application is open and create if it is to
be opened. Love to hear

your comments.



Pepe







> > Hi EveryOne,

> >

> > I have this code in ASP, which is supposed to open a word document and

> save it

> > as html document. I am trying to use this to convert word document to

> html in

> > batch mode.

> >

> > At times the code opens the word document and converts it to html. All

> this is

> > done without word or html documents being visible. At other times it

> just sits

> > there and nothing happens. The IE seems to stay put.

> >

> > Here is the code in question. Any suggestion of help is appreciated.

> >

> > <%

> >  Const wdFormatHTML = 8

> >

> >  Dim objWord

> >

> >  Set objWord = CreateObject("Word.Application")

> >  objWord.Documents.Open "c:\temp\r.doc"

> >  objWord.ActiveDocument.SaveAs "c:\temp\R.html", wdFormatHTML

> >

> > objWord.ActiveDocument.Close

> > objWord.Quit '<============== Important!!!

> > Set objWord = Nothing

> >

> >  %>




  Return to Index