Hi,
I've written some code which creates and then attaches a blank Note to an e-mail:
This works exactly as I want with one bit missing - how do I open the attached note so it is ready for the user to add some text directly, without having to double click to open it?
I have done some Googling and found that Outlook will save copies of attachments in a temporary folder when you want to open it but when I tried this, the text I added to the opened note was not saved to the note attached to the e-mail. I am able to achieve this manually though - if I run the code above, open the note by double clicking, add some text, close the note and then re-open it - the text I added still remains in the note attached to the e-mail.
Any help on this would be much appreciated.
Thanks,
Emmy
I've written some code which creates and then attaches a blank Note to an e-mail:
Code:
Sub AddNote()
Dim objExplorer As Explorer
Dim OutlookMsg As MailItem
Dim objNote As Object
Set objExplorer = Outlook.Application.ActiveExplorer
If objExplorer.Selection.Count = 0 Then
MsgBox "An e-mail needs to be selected"
Exit Sub
Else
Set OutlookMsg = objExplorer.Selection.Item(1)
End If
Set objNote = Outlook.Application.CreateItem(olNoteItem)
objNote.Save
OutlookMsg.Attachments.Add objNote
objNote.Delete
End Sub
This works exactly as I want with one bit missing - how do I open the attached note so it is ready for the user to add some text directly, without having to double click to open it?
I have done some Googling and found that Outlook will save copies of attachments in a temporary folder when you want to open it but when I tried this, the text I added to the opened note was not saved to the note attached to the e-mail. I am able to achieve this manually though - if I run the code above, open the note by double clicking, add some text, close the note and then re-open it - the text I added still remains in the note attached to the e-mail.
Any help on this would be much appreciated.
Thanks,
Emmy