开发者

Create a macro in Excel that generates a Word doc

I would like to create a macro in Excel to copy data from specific cells in an Excel file and populate those values into a MS Word form using Office 2007. I would need it to create a new Word document in the same template for each Excel row. As new rows are added, an additional Word document is 开发者_StackOverflow社区generated. It may be better if the user can specify the row.

Is this possible? Essentially the Excel file contains name, contact info and I'd like to populate that information into a Word document to avoid manual, duplicate entry.


If your question is whether this can be done through VBA, the answer is yes. This will require some VBA programming ability as well as knowledge of both the Word and Excel object heiracrhies. You can use Office automation to create an instance of Word:

Dim objWordApp As Word.Application
Set objWordApp = CreateObject("Word.Application")

You can use the object to open and save documents, manipulate document content, etc.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜