且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何自动邮件合并文件名称中的变量?

更新时间:2021-11-15 19:52:10

代码"几乎不能正常工作"。它涉及三个应用程序(Outlook,Word和Excel)并且没有正确地解决它们中的任何一个。

The code doesn't 'almost work'. It involves three applications (Outlook, Word and Excel) and doesn't properly address any of them.

您想从这三个应用程序中运行此代码中的哪一个?如果您将工作表作为电子邮件附件接收,则从Outlook运行它是有意义的,因为它可以自动运行。然后这个名称无关紧要,因为附加到收到的消息的工作簿是

Which of the three applications do you want to run this code from? If you are receiving the worksheet as an e-mail attachment, it would make sense to run it from Outlook, as it could then be run automatically. Then the name wouldn't matter so much as it's the workbook attached to the received message.

无论这是否可行,我们仍然必须确定文件是什么您通过电子邮件发送到该工作簿中的地址。它是代码暗示的邮件合并吗?该邮件的数据是否合并到工作簿中?

Whether or not that is possible, we still have to establish what the document is that you are e-mailing to the addresses in that workbook. Is it a mail merge as your code implies? Is the data for that mail merge in the workbook?

如果这两个问题的答案都是肯定的,那么可能会节省一些时间来使用
http://www.gmayor.com/ManyToOne.htm 功能在一对一模式。如果没有,那么让我们确切地知道你要做什么以及'文件'的性质。

If the answer to both those questions is yes, then it might save you some time to use http://www.gmayor.com/ManyToOne.htm  in one to one mode. If not then let us know exactly what you are trying to do and the nature of the 'document'.