M
Max Bialystock
Could someone please show me how to modify this script so that the voting
buttons (1, 2, 3) are created programmatically?
(That is without user input.)
Thanks,
Max
------------------------------------------------------------
Sub CreateVoteMessage()
Dim objApp As Outlook.Application
Dim strMsg As String
Dim strActions As String
Dim arrActions() As String
Dim I As Integer
Dim objMessage As Outlook.MailItem
Dim objAction As Outlook.Action
strMsg = "Enter voting button titles, " _
& "separated by commas."
strActions = InputBox(strMsg, "CreateVoteMessage")
If strActions <> "" Then
arrActions = Split(strActions, ",")
Set objApp = CreateObject("Outlook.Application")
Set objMessage = objApp.CreateItem(olMailItem)
With objMessage
.To = "(e-mail address removed)"
End With
For I = 0 To UBound(arrActions)
Set objAction = objMessage.Actions.Add
With objAction
.CopyLike = olRespond
.Enabled = True
.Name = arrActions(I)
.Prefix = ""
.ReplyStyle = olOmitOriginalText
.ResponseStyle = olPrompt
.ShowOn = olMenuAndToolbar
End With
Next I
objMessage.Display
End If
Set objApp = Nothing
Set objMessage = Nothing
Set objAction = Nothing
End Sub
buttons (1, 2, 3) are created programmatically?
(That is without user input.)
Thanks,
Max
------------------------------------------------------------
Sub CreateVoteMessage()
Dim objApp As Outlook.Application
Dim strMsg As String
Dim strActions As String
Dim arrActions() As String
Dim I As Integer
Dim objMessage As Outlook.MailItem
Dim objAction As Outlook.Action
strMsg = "Enter voting button titles, " _
& "separated by commas."
strActions = InputBox(strMsg, "CreateVoteMessage")
If strActions <> "" Then
arrActions = Split(strActions, ",")
Set objApp = CreateObject("Outlook.Application")
Set objMessage = objApp.CreateItem(olMailItem)
With objMessage
.To = "(e-mail address removed)"
End With
For I = 0 To UBound(arrActions)
Set objAction = objMessage.Actions.Add
With objAction
.CopyLike = olRespond
.Enabled = True
.Name = arrActions(I)
.Prefix = ""
.ReplyStyle = olOmitOriginalText
.ResponseStyle = olPrompt
.ShowOn = olMenuAndToolbar
End With
Next I
objMessage.Display
End If
Set objApp = Nothing
Set objMessage = Nothing
Set objAction = Nothing
End Sub