How to use the Aspose.Word in Visual basic

Hai,
I want sample code for word document with mail merge operatons using Aspose.Word in Visual basic 6.0. i am tried using com introp, but i got error is Object required.
Code is below

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

Thanks
Kesavan.G

Hi

Thanks for your inquiry. Here is simple code example:

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

'Open template document
Dim Doc
Set Doc = helper.Open("C:\Temp\in.doc")

'Here you should get data from your datasource
'As an example the RecordSet was created on fly
'Create new RecordSet
Dim rsParam
Set rsParam = CreateObject("ADODB.Recordset")
rsParam.Fields.Append "FirstName", CInt(129), CInt(40), False
rsParam.Fields.Append "LastName", CInt(129), CInt(40), False
rsParam.Fields.Append "City", CInt(129), CInt(40), False

rsParam.Open
'Fill RecordSet
rsParam.AddNew Array("FirstName", "LastName", "City"), Array("James", "Bond", "London")

'You also can use ExecuteWithRegionsADO method
'Execute MeilMerge
Doc.MailMerge.ExecuteADO rsParam
'Save document
doc.Save("C:\Temp\out.doc")
rsParam.Close()

Please make sure that you registered Aspose.Words.dll properly, as described here:
https://docs.aspose.com/words/net/supported-platforms/#com
Best regards.

This is worked in Windows XP machine. but it doesn’t work in Windows Server 2003 machine

Hi

Thank you for additional information. I just tested on Windows Server 2003 SP2 and all works fine.
Best regards,