Turtleman10
Technical User
I am using some very simular code in outlook to change the subject line. When I try to use it in this instance I get an error on the object Outlook.Application.ActiveInspector.currentItem. I can use the object Outlook.Application but its not going to do what I need it to do. Any ideas?
Code:
Private Sub Accept_Click()
Dim Item As Outlook.Application
Set Item = New Outlook.Application
'Set Item = New Outlook.Application.ActiveInspector.currentItem
Item.Subject = "PN_" + tbPartN + "_SD_" + tbShipDT + "_PO_" + tbPO
strSubjectA = strA + tbShipDT + tbPartN + tbRev + ".PDF"
'Copy attachment for Kohler
For Each ITEM2 In objSel
Set myAttachments = ITEM2.Attachments
If myAttachments.Count > 0 Then
For i = 1 To myAttachments.Count
myAttachments(i).SaveAsFile myOrtK & strSubjectA
Next
End If
Next
'Chance to cancel E-mail if it was a mistake
Prompt$ = "Do you want to send this Cert to Kohler?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Attachment") = vbNo Then
Cancel = True
Exit Sub
End If
End Sub