We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to use the Aspose.Word in Visual basic


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”)




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

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


'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



Please make sure that you registered Aspose.Words.dll properly, as described here:


Best regards.

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


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

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

Best regards,