GetMailMergeData

function GetMailMergeData(nSheet: number = null, bWithFormat: boolean = false): string[][]

Description

Returns the mail merge data.

Parameters

nSheetnumberdefault: null

The sheet index.

bWithFormatbooleandefault: false

Specifies that the data will be received with the format.

Returns

string[][]

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetColumnWidth(0, 20);
oWorksheet.GetRange("A1").SetValue("Email address");
oWorksheet.GetRange("B1").SetValue("Greeting");
oWorksheet.GetRange("C1").SetValue("First name");
oWorksheet.GetRange("D1").SetValue("Last name");
oWorksheet.GetRange("A2").SetValue("user1@example.com");
oWorksheet.GetRange("B2").SetValue("Dear");
oWorksheet.GetRange("C2").SetValue("John");
oWorksheet.GetRange("D2").SetValue("Smith");
oWorksheet.GetRange("A3").SetValue("user2@example.com");
oWorksheet.GetRange("B3").SetValue("Hello");
oWorksheet.GetRange("C3").SetValue("Kate");
oWorksheet.GetRange("D3").SetValue("Cage");
var aMailMergeData = Api.GetMailMergeData(0);
oWorksheet.GetRange("A5").SetValue("Mail merge data: " + aMailMergeData);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).