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

Free Support Forum - aspose.com

MailMerge coding

Any idea why this doenst work?

I have preset values for the variables to strings

Dim HeadVal As Object()

HeadVal = New Object(11) {}

HeadVal(0) = MfDocStatus

HeadVal(1) = mfProgramName

HeadVal(2) = mfWaivorNfl

HeadVal(3) = mfContractor

HeadVal(4) = mfContractno

HeadVal(5) = mfPCIN

HeadVal(6) = mfDocNo

HeadVal(7) = mfDocRev

HeadVal(8) = mfCage

HeadVal(9) = mfCBDNO

HeadVal(10) = Mfdarorncn

HeadVal(11) = MfDARorNFL

'Fill the fields in the document with user data.

WrdDoc.MailMerge.Execute(New String() {"MfDocStatus", "mfProgramName", "mfWaivorNfl", "mfContractor", "mfContractno", "mfPCIN", "mfDocNo", "mfDocRev", "mfCage", "mfCBDNO", "Mfdarorncn", "MfDARorNFL"}, HeadVal(11))

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

Thanks for your request. Here is your code (I highlighted the mistake):

WrdDoc.MailMerge.Execute(New String() {"MfDocStatus", "mfProgramName", "mfWaivorNfl", "mfContractor", "mfContractno", "mfPCIN", "mfDocNo", "mfDocRev", "mfCage", "mfCBDNO", "Mfdarorncn", "MfDARorNFL"}, HeadVal(11))

You should use the following

WrdDoc.MailMerge.Execute(New String() {"MfDocStatus", "mfProgramName", "mfWaivorNfl", "mfContractor", "mfContractno", "mfPCIN", "mfDocNo", "mfDocRev", "mfCage", "mfCBDNO", "Mfdarorncn", "MfDARorNFL"}, HeadVal)

If this will not help, please attach your template for testing.

Best regards.