【发布时间】:2017-10-31 01:11:57
【问题描述】:
我有以下用于电子邮件的 VBA 代码:
Sub Global_Email_Message()
Content = "<style> p {background-color: #d9d9d9} </style><p> This message should be global so I can use it in every sub for an E-Mail </p>"
If ExitAll = False Then
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.display
End With
signature = OMail.HTMLBody
With OMail
.To = "test@test.de"
.Subject = "test"
.HTMLBody = Content
End With
Set OMail = Nothing
Set OApp = Nothing
Else
End If
End Sub
这段代码完美运行。
现在,我想实现变量“Content”中的 message 和 style 是全局的,因此我可以在不同的电子邮件订阅。如何为不同的电子邮件订阅者全球化“内容”变量?
【问题讨论】: