Micro Focus QTP (UFT) Forums
Unable to send an email from Outlook which is already opened as draft - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to send an email from Outlook which is already opened as draft (/Thread-Unable-to-send-an-email-from-Outlook-which-is-already-opened-as-draft)



Unable to send an email from Outlook which is already opened as draft - attiliv - 03-24-2013

Hi,

I want to send an email with attachment from outlook which is already opened as draft email with TO address & subject. Also want to Open and take a screenshot of the received Auto generated email in Inbox.

I have a code to send an email with attachment but i am not able to Open a received email, is there is any code for that.

Code:
Set OlAPP = CreateObject("Outlook.Application")
Set Olns = OlApp.GetNameSpace("MAPL")
Olns = Logon
Set ObjFolder = Olns.GetDefaultFolder(6)
ObjFolder.Display
Set msg = OlApp.CreateItem(OlMailItem)
Set Recpt = msg.Recipients.Add("vijayram143@gmail.com")
msg.Attachments.Add "FilePath"
msg.Send
OlAPP.Quit
Set OlApp = Nothing
Set Olns = Nothing