ms word - c# mail merge unable to get datafields other than datafield of first record -
as title stated unable retrieve datafield besides first record.
below code.
doc.mailmerge.datasource.firstrecord = 1; doc.mailmerge.datasource.lastrecord = 5; foreach (mailmergedatafield datafield in doc.mailmerge.datasource.datafields) { datafieldarray[datacounter] = datafield.value.tostring(); datacounter++; }
to parse between datafields of datasources, setting firstrecord , lastrecord properties alone not work.
you'd need use activerecord change position of datasource, , navigate through subsequent records.
refer this answer parse.
msdn link helpful
Comments
Post a Comment