Free Support Forum - aspose.com

Compatibility of Aspose.Words for .NET API with Aspose.Words.ComHelper

Is there a new release for Aspose.Words.ComHelper? Your latest release of Aspose.Words is not compatible with the ComHelper class.

My code blowup while trying to create the ComHelper object:
set comHelper = Server.CreateObject("Aspose.Words.ComHelper")

The complete function is as follows:

Sub CreateAsposeObj
'// CREATE THE ASPOSE.WORDS COMHELPER ASP WRAPPER OBJECT TO EDIT WORD DOCUMENTS
set comHelper = Server.CreateObject("Aspose.Words.ComHelper")
licenseFile = rw_cfg("basedir") & "lib\Aspose.Words.lic"
Set License = Server.CreateObject("Aspose.Words.License")
License.SetLicense(licenseFile)
If Err.number <> 0 Then
Response.redirect("/Error.asp?Message=ASPOSE OBJECT COULD NOT BE CREATED - " & err.description )
Response.end
End If
strMergeDoc = strPdfDocSetTmpPath & "MergeDocument.doc"
'set fsObj = CreateObject("Scripting.FileSystemObject")
End Sub

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. What do you mean? ComHelper works fine on my side. Actually ComHelper is a very simple class it is used only for opening document (you need this class because COM doesn’t support constructors with parameters). ComHelper class looks like the following.

public class DocLoader

{

public DocLoader()

{ }

public Aspose.Words.Document LoadFromFile(string path)

{

return new Aspose.Words.Document(path);

}

}

Maybe you should register Aspose.Words.dll in GAC.

gacutil /i C:\Program Files\Aspose\Aspose.Words\Bin\net2.0\Aspose.Words.dll.

Could you please provide me more information about error you get?

Best regards.

The error is as follows:

***
Server object error 'ASP 0177 : 80131040'

Server.CreateObject Failed

/Includes/DocFunctions.asp, line 7

80131040
***

This is the first I've heard of "gacutil". I was told to use "regasm" to register the dll(s). Am I not right?

I successfully ran the "gacutil" command:
gacutil /i "C:\Program Files\Aspose\Aspose.Words\Bin\net2.0\Aspose.Words.dll"

However, it made no difference. I still recieve the same error.

If I use "regasm" to register the an older version of the Aspose.Words.dll everything works fine.

I've attached a zipped copy of DocFunctions.asp

Hi

I tried using the following simple code and all works fine on my side.

'Create a ComeHelper

Dim helper

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

'Open document

Dim doc

Set doc = helper.Open(Server.MapPath("in.doc"))

'Create DocumentBuilder

Dim builder

Set builder = CreateObject("Aspose.Words.DocumentBuilder")

builder.Document = doc

'Edit document

builder.Writeln("Edited by Aspose.Words")

'Save document

doc.Save(Server.MapPath("out.doc"))

Have you tried to restart IIS? Maybe this helps.

Best regards.

Yes, I run IISRESET every time I change DLL(s).

I've tried running a test program that uses the same ComHelper and I get a little bit different error:

***
msxml3.dll error '80131040'

The system cannot locate the object specified.

/XTest/UploadDoc.asp, line 48
***

Have any ideas?

Maybe you should also add this dll to GAC. I found the following page, it seems that there is the same problem.

Best regards.

My attempt to add C:\Windows\system32\msxml3.dll to the GAC failed. See below:

"Failure adding assembly to the cache: The module was expected to contain an assembly manifest."

Any other ideas?

Hi

Maybe you should use regsvr32 msxml3.dll. Hope this helps.

Best regards.

Already tried regsvr32.

I assume you are using the latest Aspose.Pdf and Aspose.Words, but can you tell what version of AsposeComWrapper.dll you are using? Mine is dated 07/17/2007 12:11 PM and is 16,384 bytes in size.

OK. I must have installed something incorrectly. I uninstalled both Aspose.Pdf and Aspose.Words, downloaded the latest versions of both, and reinstalled them. Things are looking much better now. Perhaps I didn't select to install for All users the last time.

Thanks for your help.

Hi

It is nice that you found the problem. I created ComWrapper myself using the following manual.

How to create a wrapper to assist in calling Aspose.Words methods from classic ASP

Best regards.

Your link to the “How to create a wrapper to assist in calling Aspose.Words methods from classic ASP” webpage contains the following two links that both default to the “Products” webpage.

  • Utilize Aspose.Words from COM Clients (ASP, VB, VBScript)
  • ASP/ASP.NET without Visual Studio - an Instant Primer

I was expecting more information about the COM helper. Do those webpages still exist?

Default “Products” webpage = File Format APIs for .NET Core, Java, C++, Android

Hi

Please see the following links.

Best regards.