Dear all,
During a upgrade process i came across a codeunit which is used for mail merge using word automation. I was able to add fields using Dotnet Variables related to word. But in later part the Merged Document Contain a table and i am unable to find dotnet automation and code for same.
Below is the sample example.
I want Customer Name from Customer Tables & All Customer Ledger Entries details for that customer. Below is the code -
Code in NAV 2009 Using Automation -wdRange := wdApp.ActiveDocument.Fields.Item(1).Result;
wdRange.Text := FORMAT(Customer.Name);
Code Upgraded in NAV 2013 using Dotnet -AddField('Customer_Name');
AddField(Customer.Name);
Code in NAV 2009 Using Automation - (I am unable to upgrade this part)
wdTable := wdDoc.Tables.Add(wdRange,1,2);
RowCounter := 1;
wdTable.Rows.Height := 20;
wdTable.PreferredWidth := 500;
wdTable.Cell(1,1).PreferredWidth := 150;
wdTable.Cell(RowCounter,1).Range.Text := PostingDate;
wdTable.Cell(RowCounter,1).Range.Bold := 1;
wdTable.Cell(RowCounter,1).Range.Underline := 1;
wdTable.Cell(RowCounter,2).Range.Text := CustLedEntry."Posting Date";
wdRow := wdTable.Rows.Add;
RowCounter += 1;
....
Please suggest the possible ways to upgrade the second part of code when its creating a table and inserting data into the table.
Thanks in advance.
Answers
You can use html tags for this. Try this code:
Thanks for the reply and sorry for delay in update as i was able to use HTML Tag already.
But with HTML it comes with certain limitation in HTML Tags -
1. Like i cannot specify the BOLD, ITALICS in the HTML Table Column.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
Also, I tried bulletin, indention or right aligned text but this doesn´t work either. Does anybody know a solution to this?