English 中文(简体)
使用《展望VBAVBA》中的地址簿
原标题:Using the Addressbook in Outlook VBA

有人在工作,问我能否实施一个简单系统,让他根据他可以输入的几个参数发送Outlook模板邮件。

举例来说,这样的信息就是:

"Hello,

Please be informed that system **Parameter1** is current down.

Regards,"

我在想如何在 Outlook VBA 中制作一个表格, 以动态方式查找在某个模板中找到像参数( 如 parameters\\\\/code > ) 一样的字符串样式( 如 < code\ parameters\\\\\/ code > ) 的次数, 并随后为每个找到的参数在表格中创建编辑框 。

问题是,我显然想为接受者添加一个方框。我需要找到一种方法来调用《展望地址簿》,并使它表现得像一个。这比我所希望的要不那么直观。 到目前为止,我只做了以下工作:

Dim snd As Outlook.SelectNamesDialog
Dim displayLL As Boolean

Set snd = Application.Session.GetSelectNamesDialog()
snd.NumberOfRecipientSelectors = Outlook.OlRecipientSelectors.olShowTo
snd.AllowMultipleSelection = True
displayLL = snd.display()

正如你所看到的,这只会打开地址簿,让我选择几个地址。但我对如何在普通 Outlook 邮件中 做一些实际的“to:” 和“CC:” 字段感到困惑。

最佳回答

考虑到我最终选择了一条完全不同的路线,我不清楚这有多重要,但我认为我还是应该加上这个,因为没有人回答。

I simply created a form that would list all templates by searching through the templates folder in the %AppData%. I would then loop through the entire mail looking for parameter-styled strings and ask for the desired value each time I would encounter such a string (through a simply inputbox). Instead of adding a custom "recipients" box, I simply opened a new mail with the parameters filled out correctly. The user could then simply add recipients to the mail like he usually would, and he was fine with this. That way, he was also able to double-check if the mail indeed looked exactly like he wanted to.

一个7岁的孩子 没有什么花哨的,什么的,什么的, 一个7岁的孩子做不了的, 但是它的工作原理。

问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...