I found the following code on your site regarding using Aspose products with a COM product like VB6.
Dim Word as Object
Set Word = CreateObject("Aspose.Word.Word")
Dim Document as Object
Set Document = Word.Open("MyInputFileName.doc")
Document.Save("MyOutputFileName.doc")
The code errors on the line:
Set Word = CreateObject("Aspose.Word.Word")
with the follwoing message: File or assembly name Aspose.Word, or one of its dependencies, was not found.
Thanks for your request. Aspose.Word is old namespace. Currently we are using Aspose.Words.
There is no Aspose.Words.Word class. Please see documentation for more information.
I suppose you are trying to run old code with the latest version of product. Have you tried to run code provided in the article I suggested in my previous post?
Thanks for your inquiry. Please try using the following code:
'Create a document
Dim Doc
Doc = CreateObject("Aspose.Words.Document")
'Create a DocumentBuilder
Dim Builder
Builder = CreateObject("Aspose.Words.DocumentBuilder")
Builder.Document = Doc
Builder.Font.Size = 48
'ParagraphAlignment.Center = 1
Builder.ParagraphFormat.Alignment = 1
Builder.Writeln("Hello, World!")
'Create a .NET memory stream to save the document to.
Dim stream
stream = CreateObject("System.IO.MemoryStream")
'Save the document to the stream.
'We use an overloaded version of the Save method: Document.Save(object, SaveFormat)
'SaveFormat.Doc = 1
doc.Save_4(stream, 1)
Response.Clear()
'Specify the document type.
Response.ContentType = "application/msword"
'Other options:
'Response.ContentType = "text/plain"
'Response.ContentType = "text/html"
'Specify how the document is sent to the browser.
Response.AddHeader("content-disposition", "attachment; filename=MyDocument.doc")
'Another option could be:
'Response.AddHeader "content-disposition","inline; filename=MyDocument.doc";
'Get data bytes from the stream and send it to the response.
Dim bytes
bytes = stream.ToArray()
Response.BinaryWrite(bytes)
Response.End()
I have tried your code and still get the error. The code I was trying is included in the 1st post I sent. As I stated previously the error occurs on the line where I attempt to create the object:
Doc = CreateObject("Aspose.Words.Document")
This is the same line of code as in my original post where the error occurs. The error is:
Thanks for your inquiry. Maybe you should also register Aspose.Words assembly for COM. It is possible to register Aspose.Words for COM Interop manually by executing the following command:
regasm.exe is a tool included in .NET Framework SDK. All the .NET Framework SDK tools are located in the \Microsoft .NET\Framevork\ directory, e.g. C:\Windows\Microsoft .NET\Framework\v1.1.4322. If you use Visual Studio .NET, it is handy to select 'Start | Programs | Microsoft Visual Studio .NET 2003 | Visual Studio .NET Tools | Visual Studio .NET 2003 Command Prompt. It will run command prompt with all the necessary environment variables set.