Save a new Word Document for each row in Excel

ε祈祈猫儿з 提交于 2020-01-14 06:23:28

问题


I have an Excel file with a list of names as follows:

*--------------------------------------*
| Last, First Middle | email@site.edu  |
*--------------------------------------*

All email addresses are "@site.edu"

I have a Word file like this

Dear <name>,
...

Is there a way to automatically save a copy of the Word document with the name cell inserted over and save the file as "email" where "email" is the email address without site.edu?

I would also like to change to be First Middle Last, but I can handle that by saving the Excel as .CSV and using a text editor with regular expressions. I just don't know enough about the capabilities of Office to know if this is possible to automate.


回答1:


It sounds like you just need to use Word's mail merge feature, which will allow you to use the Excel list as a source file for the salutation names and will create a personalized letter/document for each row. They could then print the whole merged document.




回答2:


you can do alot with JScript, obviously only targeting Windows/IE. You can access your documents via IE too. http://msdn.microsoft.com/en-us/library/7sw4ddf8(v=vs.85).aspx this link has a function for manipulating an Excel document, there's also a section for Word. http://www.thescriptlibrary.com/Default.asp?Action=Display&Level=Category3&ScriptLanguage=VBScript&Category1=Microsoft%20Office&Category2=Microsoft%20Excel&Title=Add%20Formatted%20Data%20to%20a%20Spreadsheet i'm sure you can put them together into what ya need. sorry for not doing it for ya, i hate opening up Office documents.



来源:https://stackoverflow.com/questions/7425093/save-a-new-word-document-for-each-row-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!