D
donald
hi there,
i trying to run the code below but when i send the e-mail it doesn't
keep track of the item so when i try and create a Journal and attach it
to it, it doesn;t work it said the item as been delete or move which is
right? how can i keep track of it to add it to the Journal??
thanks
Jonathan
Dim myItem As outlook.MailItem
myItem =
_Application.CreateItem(outlook.OlItemType.olMailItem)
Dim myAttachments As outlook.Attachments =
myItem.Attachments
With myAttachments
.Add(letter, 1, 1, "Enquiry Letter")
.Add(IDDDoc, 1, 1, "Initial Disclosure Document")
.Add(FFDoc, 1, 2, "Mortgage Fact Find")
.Add(DPNDoc, 1, 3, "Data Protection")
.Add(TNDoc, 1, 4, "Terminology Notice")
End With
With myItem.Links
For i As Integer = 1 To mcase.Links.Count
myItem.Links.Add(mcase.Links(i).Item)
Next
End With
InputBox(myItem.EntryID, "myItem", myItem.EntryID)
With myItem
.SentOnBehalfOfName = "Malbridge MS"
.To = "(e-mail address removed)"
'mcase.Links(1).Item.Email1Address
.SaveSentMessageFolder =
_NameSpace.Folders.Item("MailBox - Malbridge MS").Folders("Sent Items")
.Subject = "Appointments for "
.Body = "Dear " +
mcase.Links(1).Item.UserProperties.Find("Salutation").Value + Chr(10) +
Chr(10) + _
"Please see attach Document" + Chr(10) + Chr(10) +
_
mcase.Links(1).Item.ManagerName
.Send()
End With
With mJournal
.Subject = "Sent ENQ for " & mcase.Subject
.Type = mcase.Subject
'.Body =
.Save()
For i As Integer = 1 To mcase.Links.Count
.Links.Add(mcase.Links.Item(i).Item())
Next
.Save()
.Attachments.Add(myItem,
Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , "ENQ
letter")
..Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olSave)
End With
i trying to run the code below but when i send the e-mail it doesn't
keep track of the item so when i try and create a Journal and attach it
to it, it doesn;t work it said the item as been delete or move which is
right? how can i keep track of it to add it to the Journal??
thanks
Jonathan
Dim myItem As outlook.MailItem
myItem =
_Application.CreateItem(outlook.OlItemType.olMailItem)
Dim myAttachments As outlook.Attachments =
myItem.Attachments
With myAttachments
.Add(letter, 1, 1, "Enquiry Letter")
.Add(IDDDoc, 1, 1, "Initial Disclosure Document")
.Add(FFDoc, 1, 2, "Mortgage Fact Find")
.Add(DPNDoc, 1, 3, "Data Protection")
.Add(TNDoc, 1, 4, "Terminology Notice")
End With
With myItem.Links
For i As Integer = 1 To mcase.Links.Count
myItem.Links.Add(mcase.Links(i).Item)
Next
End With
InputBox(myItem.EntryID, "myItem", myItem.EntryID)
With myItem
.SentOnBehalfOfName = "Malbridge MS"
.To = "(e-mail address removed)"
'mcase.Links(1).Item.Email1Address
.SaveSentMessageFolder =
_NameSpace.Folders.Item("MailBox - Malbridge MS").Folders("Sent Items")
.Subject = "Appointments for "
.Body = "Dear " +
mcase.Links(1).Item.UserProperties.Find("Salutation").Value + Chr(10) +
Chr(10) + _
"Please see attach Document" + Chr(10) + Chr(10) +
_
mcase.Links(1).Item.ManagerName
.Send()
End With
With mJournal
.Subject = "Sent ENQ for " & mcase.Subject
.Type = mcase.Subject
'.Body =
.Save()
For i As Integer = 1 To mcase.Links.Count
.Links.Add(mcase.Links.Item(i).Item())
Next
.Save()
.Attachments.Add(myItem,
Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , "ENQ
letter")
..Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olSave)
End With