我是一个非常新的人,我正在尝试创建VBA代码,它将替换我的Outlook会议样板中的令牌,但无法正确获取代码。任何帮助将不胜感激。
这就是我目前所拥有的:
Sub Kickoff()
Dim objreply As Outlook.MeetingItem
Dim strhtml As String
Dim strproject As String
Set myItem = Application.CreateItemFromTemplate("C:\Users\ttupper\AppData\Roaming\Microsoft\Templates\DAVA Kickoff.oft")
myItem.Display
strproject = InputBox("Enter Application Name", "replace %appname%")
End Sub
答案 0 :(得分:0)
假设你在样板文件的某个地方有appname,你就可以这样替换。
Option Explicit
Sub Kickoff()
Dim myItem As MailItem
Dim strproject As String
Set myItem = Application.CreateItemFromTemplate("C:\Users\ttupper\AppData\Roaming\Microsoft\Templates\DAVA Kickoff.oft")
myItem.Display
strproject = InputBox("Enter Application Name", "replace %appname%")
myItem.HTMLBody = Replace(myItem.HTMLBody, "appname", strproject)
End Sub