HI I know this for outlook,
if any body can help me on this,
have this code in outlook to open combobox and it work when select the template nothing happens and sometimes get error run time error 432 and highlight this line: Set oMail = Application.CreateItemFromTemplate(strTemplate)
here it's the code:
thank you
if any body can help me on this,
have this code in outlook to open combobox and it work when select the template nothing happens and sometimes get error run time error 432 and highlight this line: Set oMail = Application.CreateItemFromTemplate(strTemplate)
here it's the code:
Code:
Public Sub ChooseTemplate()
'Dim oMail As Outlook.MailItem
'im oContact As Outlook.ContactItem
'If TypeName(ActiveExplorer.Selection.Item(1)) = "ContactItem" Then
' Set oContact = ActiveExplorer.Selection.Item(1)
Dim strTemplate As String
UserForm1.Show
Select Case lstNum
Case -1
' -1 is what you want to use if nothing is selected
strTemplate = "Requesting Payment"
Case 0
strTemplate = "C.C. Authorization2"
Case 1
strTemplate = "Payment Inquiry-Current_Pastdue2"
Case 2
strTemplate = "Payment Inquiry-Current_Pastdue_Aging."
Case 3
strTemplate = "Provide C.C. Information_2.oft"
Case 4
strTemplate = "Refund Approval"
Case 5
strTemplate = "Contra Approval"
Case 6
strTemplate = "Terminate Due to Non Payment"
Case 7
strTemplate = "Remittance Address"
End Select
strTemplate = "C:\Documents and Settings\rossj1\Application Data\Microsoft\Templates\" & strTemplate & ".oft"
Set oMail = Application.CreateItemFromTemplate(strTemplate)
'With oMail
' .To = oContact.Email1Address
' .ReadReceiptRequested = True
' .Subject = "My Macro test"
' .Body = "Hi " & oContact.FirstName & "," & vbCrLf & vbCrLf & oMail.Body
' .Display
'End With
' End If
Set oMail = Nothing
End Sub
thank you