COM Wrapper for Aspose.Words

Oh, I see. Yes, that looks like a big problem for now. The issue is logged to our defect base and we will try to provide some workaround for this in our next version.

Thanks for your support.

Do you know, or can I check, the status of the logged issue?

I will post a notification in this thread once the hotfix will be available.

Hi Vladimir,

I appreciate your support in this matter, and look forward to using the enhanced ComHelper class to enable finding and replacing single mergefields inside Word documents.

My supervisor is wanting to know the estamated time of completion. Do you have anything, time-wise, I can tell him?

Ok, attached is a workaround for you. It contains small .NET DLL with a wrapper for GetFieldNames() method.

You need to put this DLL in your ASP application dir. Then, register it, running “regasm AsposeComWrapper.dll /codebase” command in command line prompt. You may requre setting proper regasm path to be able to do that.

The simple ASP application showing how to use the wrapper is also included in the attachment.

Please try this up and let me know if it worked for you.

Thank you very much.

On all attempts to register AsposeComWrapper.dll the following error from RegSvr32 occurs:

“AsposeComWrapper.dll was loaded, but the DllRegisterServer entry point was not found. This file can not be registered.”

What’s with that?

You should use RegAsm for registering. When you install the .NET Framework version 1.1, RegAsm.exe is placed in the following default directory:

[Windows]\Microsoft.NET\Framework\v1.1.4322

Du. I’m an idiot. Now I noticed you already told me that in the previous email. Sorry.

It regitered fine. I’ll be testing it shortly.

Thanks again.

See also my blog post dedicated to your problem:
https://docs.aspose.com/words/net/supported-platforms/#com

OK. I successfully registered AsposeComWrapper.dll, and while running your test.asp I received:

ASP Error Information:
Page: /DocSystem/Wrapper/test.asp
File: /DocSystem/Wrapper/test.asp [13]

Source:
Category:
Description:
Number: 0x80070002 (-2147024894)

Looks like the error is at the following line:
Set methods = CreateObject(“AsposeComWrapper.Methods”)

Make sure that AsposeComWrapper.dll is present in the same dir as test.asp. Don’t forget to use /codebase key when registering the dll. ‘/codebase’ key gives a warning when trying to register assembly which was not strong signed. I have not seen any problems due to it but still I am sending you strongly signed version.

And one more thing that I have found today. You need to set ‘read’ and ‘read and execution’ permission for IUSR_[ACCOUNTNAME] account for the file AsposeComWrapper.dll, because ASP uses this account to run. Otherwise, you can encounter 0x800A0046 error when creating the AsposeComWrapper.Methods object.

Hope this will help,

I ran “regasm.exe AsposeComWrapper.dll /codebase” and got the following warning:

RegAsm warning: Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.

… however at the conclusion RegAsm.exe said, “Types registered successfully”.

And when I executed test.asp I got a few lines furture. This time I got as far as:

***
For Each element in methods.GetFieldNames(doc)
Response.Write(element + BR)
Next
***

… and then the following error:

***
ASP Error Information:
Page: /DocSystem/Wrapper/test.asp
File: /DocSystem/Wrapper/test.asp [19]

Source:
Category: AsposeComWrapper
Description: Could not load file or assembly ‘Aspose.Words, Version=4.2.3.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.
Number: 0x80070002 (-2147024894)
***

Please note that I have attached storngly named wrapper to my previous post.

Concerning your current problem, make sure you have Aspose.Words 4.2.3 properly setup, and, just to be sure, copy Aspose.Words.dll to your application folder.

Success!

Thank you.

Vladimir,

Can you do me a small favor? Can you have someone in your sales department contact my manager, Hanno Ginn? He desires to purchase additional Aspose software but is having a more difficult time with responses from his current sales person than I am from you.

His email address is: hginn@rmoa.com or direct phone #: 425-250-3891

Thanks. I would really appreciate it.

Dear Stephen,

Thanks for considering Aspose.

I handle sales inquiries. Please tell Hanno Ginn to post his sales related questions in Aspose.Purchase forum and he will be fully satisfied with the responses just as you are. We prefer handling inquiries through forums instead of emails as it’s more manageable. However, if Hanno likes to be contacted through phone then Merit Cooper (one of our sales representatives) may call him in US business hours.

Please feel free to contact me, if i can be of any help.

Have a nice day.

Thank you, Salman.

I’ve passed your email along to my manager.

The ComHelper class “document.range.replace” seems simple enough, but I’m not having any success yet.

Code example:
***

Set comHelper = Server.CreateObject("Aspose.Words.ComHelper")
licenseFile = "C:\Program Files\Aspose\Aspose.Words\License\Aspose.Words.lic"
Set License = Server.CreateObject("Aspose.Words.License")
License.SetLicense(licenseFile)
Set currDoc = comHelper.Open("C:\Tmp\TempDoc.doc)
currDoc.Range.Replace "<[168322]>", "TestData", True, False

***

Can you see anything wrong with the code?

Yes, you forgot to put a closing quote here:

"C:\Tmp\TempDoc.doc

Apart of that, the code does work.

Hi;

Our company is looking to purchase the Single Developer OEM license for Aspose.Words as we want to provide mail merge and document editing in our recruitment product.

Problem is our software is in ASP and i download the evaluation version and started testing it. But i started to get error for GetFieldNames method for the MailMerge class. I have followed the thread and i know the workaround of wrpper class.

Can you tell me whats the time line to get a fix for GetFieldName method which returns varaint array. ?

We do not want to use another wrapper class other then which is included in the aspose.words and reason for that is,

We have many customer which use system and we host them on our servers and provide regular updates. We can not restart our IIS as its 24/7 being used. So changing dll and registering it on regular intervals is not possible for us.

Any help would be greatly appreciated.

We need this method in order to decide to go for aspose or not.

Reason for that is, we have to provide big mail merges and can have many columns in the query. Now if the ResultSet in Vbscript is big then ASPose MailMerge gets slow. So what we want is to get the Mergefields from Template Document and only select the required columns.

Any solution to achieve that or update ComHelper or hotfix ?

Regards

Azhar