Save HTML to Word Document

Dear Experts,

I have created some letters for the users and the content are put into textareas and tables, after that they are edited by the users, then the content are outputted as HTML format.

Now I want to save this "HTML" into a word document, how can I do that?

I have tried the method posted previously by others but it didn't work

' Get the IIsWebService Admin object
'Set oWebService = GetObject("IIS://LocalHost/W3svc")

' Enable AspAllowOutOfProcComponents
'oWebService.Put "AspAllowOutOfProcComponents", True

' Save the changed value to the metabase

'set oWD = Server.CreateObject "Word.Application")
'oWD.selection.typetext "Hello, World!"
'oWD.ActiveDocument.SaveAs "C:\Temp\Hello.doc"
'set oWD = Nothing

I got the error :
Permission denied: 'GetObject'
when I execute
Set oWebService = GetObject ("IIS://LocalHost/W3svc")

can anyone tell me why?
Who is Participating?
CoreEyeConnect With a Mentor Commented:
 because if you are connecting the web site with anonymous account this error occurs. First give the site NT Authentication to connect then try it again. To do this in IIS manager select your site and click properties, at the "Directory Security" tab click "edit" and select "NT Challenge/Reponse".

And also it is enough to run this code once;

Set oWebService = GetObject("IIS://LocalHost/W3svc")

 Enable AspAllowOutOfProcComponents
oWebService.Put "AspAllowOutOfProcComponents", True


i guess you to execute this code in a seperate page once, then change your sites security settings to old state.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.