Export to Word on Web. Know how?

I need to export a document from web into Word file.I don’t need to “Show” it up. It is enough, if the file will be created on c C:\ drive.

When I try to call Word object (Set wordapp = createObject( “word.Application” )) I get an error “operation is disallowed in this session”.

Is there other way to do it over the web?

Thank you!

NN

Subject: Export to Word on Web. Know how?

I have only ever done this with Excel, but it might give you a place to start. (This is by no means final code.) If you just want data, you can try just printing the document to the screen using a Word content type. The browser should prompt the user to Open or Save.

Sub Initialize

Print |Content-Type:application/msword|



Print "TEST"

Print Chr$(10)

Print "TEST 2"

End Sub

You might also need to write out the content encoding (not sure what the syntax is but you can find it on the Web.) If you want formatting, search the Web for content type application/vnd.ms-word to see if there is a way to pass HTML. (I have used the example below to pass to Excel).

Print |Content-Type:application/vnd.ms-excel|



Print |<table>|

Print |<tr><td>|

Print doc.getItemValue(fieldName)(0)

Print |</td></tr>|

Print |</table>|

Hope this can get you started. I am curious if anyone has found another way without using a third-party product (which is also an option).

Good luck.

Subject: RE: Export to Word on Web. Know how?

Thank you, Michelle,

I’ll definitely try this one…