Translate Code from VBA (Word) to Javascript/ JScript don't work

47 Views Asked by At

I need help. I use an Mail Merge in word and I want to translate the vba code to JScript or Javascript. But the problem is that the function is not method it is a property.

Here my vba code:

Sub test()

With ActiveDocument.MailMerge
    .Destination = wdSendToNewDocument
    .SupressBlankLines = True
    With .DataSource 
             .FirstRecord = wdDefaultFirstRecord
             .LastRecord = wdDefaultLastRecord
    End With
End With
End Sub

I translate it to the following code but it don't work:

var objWord; 
objWord.ActiveDocument.MailMerge.Destination("wdSendToNewDocument") \\.... but it don't work

Do you have any idea to solve the code problem? Thanks.

0

There are 0 best solutions below