开发者

Generate word documents from excel file using mail merge

I am trying to generate word documents using the mail merge feature in Microsoft Word. To be as clear as possible my dream would be to:

(1) Place all values for all documents to be created in one excel document (2) Use Word to create a template by selecting the a开发者_JAVA技巧bove excel file as the data sheet (3) Run a macro that would use the values from the excel sheet and perhaps the built in mail merge feature of Word to generate 1 file for each line in the excel sheet using one of the cells as the name of the file to be saved.

The end result would be the ability to create x number of Word documents using a template that pulls all the values from an excel sheet including the file name of the generated document.

Please help.

Thanks in advance.


You can do it by using Word and Excel Automation, using languages such as Visual Basic 6 (through COM), VB .Net (through interop) or C# (through interop), for example for getting data from a database. In your case because you simply want to create a documente based on excel data the simplest manner is to use the MS Word Mail's Merge Wizard.

Take a look at: http://office.microsoft.com/en-us/excel-help/print-labels-by-using-excel-data-in-a-word-mail-merge-HP005203760.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜