We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Classic ASP - Opening existing document

I am very new to this and have a simple requirement using classic ASP. The first element is to simply open an existing document for editing and I have tried the following:

Dim Word
Dim Doc
Set Word = CreateObject("Aspose.Word.Word")
Set Doc = Word.Open("c:\sorce\apps\tccm\Uploaded\Installation\templates\welcomepack.doc")

However, I get an error stating that the Word object cannot be created. I seem to recall reading that the word object was redundant. If so, how do I use classic ASP to open an existing document?

Word object has been substituted with ComHelper object:

Dim helper
Set helper = CreateObject("Aspose.Words.ComHelper")")
Dim doc
Set doc = helper.Open(fileName)

Best regards,

Brilliant thanks - about the only page in the manual I did not look at!!

I am also trying to open an existing document. I copied your code as above into my ASP web page, but now when I run it I get the following message:
Cannot create ActiveX component.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error:

Line 189:
Line 190:            Dim helper
Line 191:            helper = CreateObject("Aspose.Words.ComHelper")
Line 192:
Line 193:            doc = helper.Open(strDocumentDirectory & strSavePath & strDocumentName & ".doc")

I have included an Imports statement for Aspose.Words.ComHelper at top of the page, but I still get this error message. Any help you can give would be most appreciated.
Thanks very much!

Thanks for your inquiry. Maybe you should register Aspose.Words.dll in GAC.

gacutil /i "\Aspose.Words.dll"

Can you create instance of Document class?

Dim Doc
Set Doc = CreateObject("Aspose.Words.Document")

Best regards.

Excuse me, I missed to tell you that you should use

Dim helper
Set helper = CreateObject("Aspose.Words.ComHelper")

Best regards