To create label using aspose.word

Hello,

I require to create word document with Labels, the configuration are as below

On Web Page,

  • There will be one Drop Down List of various labels types like Avery 5160 or 5162 etc, user can select the Label type from this DDL.
  • There will be two Text Box like Row and Column, where user can specify the Row and Column number into which the single address can be display.
  • After selecting Label type and inserted Row and Column, user will click on ‘Generate Report’ button.
  • When this button clicks, aspose will create document for selected label type and insert the address at specified position (row and Column)

Is this possible using aspose .word? If yes then how?

Thank you,
Jatin Mandalia

Hi Jatin,

Thanks for your query. In your case, I suggest you please create the Avery 5160 or 5162 template and use simple mail merge. I have attached the template document of Mailing Labels with this post. Please check the following code example for your kind reference.

Please read the detail of simple mail merge from here:
https://docs.aspose.com/words/net/mail-merge-and-reporting/

Document doc = new Document(MyDir + "MailingLabelsDemo.doc");
DataTable table1 = new DataTable();
table1.Columns.Add("CompanyName", typeof(string));
table1.Columns.Add("Address", typeof(string));
table1.Columns.Add("City", typeof(string));
table1.Columns.Add("PostalCode", typeof(string));
table1.Columns.Add("Country", typeof(string));
table1.Rows.Add("Alfreds Futterkiste", "Obere Str. 57", "Berlin", "12209", "Germany");
table1.Rows.Add("Alfreds Futterkiste", "Obere Str. 57", "Berlin", "12209", "Germany");
table1.Rows.Add("Alfreds Futterkiste", "Obere Str. 57", "Berlin", "12209", "Germany");
table1.Rows.Add("Alfreds Futterkiste", "Obere Str. 57", "Berlin", "12209", "Germany");
doc.MailMerge.Execute(table1);
doc.MailMerge.DeleteFields();
doc.Save(MyDir + "out.doc");

none of the link is working. Also where is the template? its missing

@Laksh,
Thanks for your inquiry. Please refer to the following article.
About Mail Merge
We have attached the input document with this post for your kind reference.
MailingLabelsDemo.zip (6.6 KB)
Moreover, please check the code examples from Aspose.Words for .NET examples repository at GitHub.
.