|
-
Mar 5th, 2018, 06:29 PM
#1
Thread Starter
Hyperactive Member
Dragging an outlook email to my VB6 app
Some functionality I would like to add to an old vb6 app.
Currently, I can drag an outlook email to the desktop and it'll create a file like this: "Email subject.msg".
Then I'm using this code to open that file/email from vb6 and it allows me to extract some informations:
Code:
Dim OL As Outlook.Application
Dim Msg As Outlook.MailItem
Set OL = New Outlook.Application
Set Msg = OL.CreateItemFromTemplate(fld & "\" & fil.Name)
' now use msg to get at the email parts
'MsgBox Msg.Subject
strFinal = Msg.body
strTo = Msg.To
strToEmail = Msg.Recipients.Item(1).Address
Set OL = Nothing
Set Msg = Nothing
This is fun. But now I wanted to do the same thing, but instead of dragging the email onto the desktop, I'd be dragging it straight into my vb6 form (example: on a textbox).
The Text1_OLEDragDrop event gets fired but I wouldn't know how to use "Data As DataObject". There could be some way of interacting with outlook in a much more sophisticated and optimized method, but honestly, if this drag-drop event could just allow me to save the .msg to, say, c:\temp\temp_email.msg, I'd be good to go with method shown above. That would completely do it.
Any idea on how to save it to file?
Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|