私はこのVBAコードを持っています:
Sub sendByCustomForm()
Dim olItem As Outlook.MailItem
Dim sText As String
If Application.ActiveExplorer.Selection.Count = 0 Then
MsgBox "No Items selected!", vbCritical, "Error"
Exit Sub
End If
For Each olItem In Application.ActiveExplorer.Selection
sText = olItem.Body
Set msg = Application.CreateItemFromTemplate("C:\myCustomForm.oft")
MsgBox sText, vbInformation, "alert"
With msg
'Set body format to HTML
.BodyFormat = Outlook.OlBodyFormat.olFormatHTML
.HTMLBody = "<HTML><BODY>" + sText + "</BODY></HTML>"
.Display
End With
Next olItem
End Sub
そのテンプレートには入力したい 2 つの ComboBox がありますが、どうすればよいですか?
これを試すと:
msg.ComboBox1.AddItem "item"
うまくいかない...