Received : 2007/07/31 00:42:01
Message : Hi Vladimir,
Thanks for the documentation. I have read this. But the main problem that I am encountering is in registration of Aspose.Words dll with my application.
My application is in ASP. I have used the following command to register it.
I registered it using visual studio .Net command prompt and I get “successfully registered the dll”, also. I am able to add the Aspose.Words dll under references section also. However, when I try to run my application I get the error “ActiveX component can’t create object”. So I guess there is some problem with the dll registration itself, or any thing else? Can you please guide.
Try to closely follow the installation guidelines stated in Utilize Aspose.Words from COM Clients (ASP, VB, VBScript) article. If it does not help please attach the code of your ASP application so that we could reproduce the problem on our side.
You must chose the Everyone option in the Select Installation Folder dialog box as shown below. If you do not do this, Aspose.Words will be COM registered for the current user and ASP application running under a different account will fail to instantiate Aspose.Words classes.
Sorry for starting a new thread every time. I will take care for the same. The code snippet was:
Dim helper
Set helper = CreateObject("Aspose.Words.Document")
Dim doc
Set doc = helper.Open("C:\\myDoc.doc")
The error occurs at the blue line. The error is Run-time automation error: The system could not find the specified file. As suggested by you I gave the necessary permissions and even used the local path, however, the error persists.
As per my analysis the automation error occurs when the dll is not loaded properly. I unregistered the dll and tried loading it again. I was successfully able to view the Aspose dlls through regedit. I could successfully see Aspose.Words.ComHelper, Aspose.Words.Documents, Aspose.Words.DocumentBuilder, Aspose.Words.License and Aspose.Words.Viewer.DocumentRenderer.
I could also successfully open the tlb file through the COM object viewer. And in the installation procedure I had selected the Everyone option in the Select Installation Folder dialog box.
I see an error in your code. You see, COM in ASP does not allow parametrized constructors. That’s why you can only use CreateObject("Aspose.Words.Document) to create a new document. And to load the document the existing file you need to use ComHelper object
Dim helper
*'You try to Aspose.Words.Document
'but you should create Aspose.Words.ComHelper instead
Set helper = CreateObject(“Aspose.Words.ComHelper”)
Sorry, I am not much of a specialist in COM. I am only sure that the following example works on my side:
Dim helper
Set helper = CreateObject(“Aspose.Words.ComHelper”)
Dim doc
Set doc = helper.Open(“c:\inetpub\wwwroot\dir1\test.doc”)
That is if my ASP page is in the same directory as the document file (c:\inetpub\wwwroot\dir1).
So to help you further I need to be able to reproduce your error. Try composing a complete test set and attach it here with instructions so that I could run it on my side and reproduce the problem. That seem to be the only way to find the cause of the problem.
I just tried out by adding the Aspose.Words.dll in GAC using the gacutil command.
It was successful and I was able to execute the code snippet without error.
I have another doubt regarding SetDataSource method. While I was going through Google search I found that in thread
there was mention about SetDataSource method for Aspose.Cells. Can I use the SetDataSource method in Aspose.Words? I am asking this because I am working on ASP application and although the methods may be available they are visible only at run-time (Guess this is because ASP is a late bound language!).
The problem is that if I use SetDataSource in my code, it gives me error: Object doesn’t support this property or method.
You can use API reference keeping in mind the guidelines described in “Usage” section of the article: https://docs.aspose.com/words/net/supported-platforms/#com
to find out what methods are supported and what parameters are accepted for these methods.
If you will check the API Reference you will find out that there is no such method as SetDataSource in our API.
I am trying to populate fields in the document using Aspose.Words.
For this I have referred to the SalesInvoiceDemo, as it uses the merge field in the document and I have similar kind of case. In this usage of MailMerge.ExceuteWithRegions property is seen.
When I try to use this property in my ASP application I get the error Object doesn’t support this property or method.
Please guide as to what can be done in this regards. I am also attaching the code in case needed please refer the same.
However, I have one more doubt. The document is saved at the location but the merge fields are empty. I mean they are not populated. I have attached the code, please go through the same and let me know if I am missing out something.
In the code you will find that I have used array to capture the values from the database (using the function getDataFromDB).
Your code does not look like the code for populating dataset
Try to follow this code closely and also try to simplify your example. Create a simple merge document with only one merge field and try to merge it with a similarly simple recordset.
I could successfully populate the merge fields for one of my reports. However, when i tried to do this separately for another report, although i didn’t get an error however my document showed me section break (next page).
I have used the same code as posted yesterday. It worked successfully for one report. However, I am not able to figure out why it is not working for another report I am trying to populate.