-2

Want to validate the receving email has attachment

Set outObj= CreateObject("outlook.Application")
Set outAccount = outObj.Session.Accounts.item(1)
Set nameSpace = outObj.GetNameSpace("MAPI")
Set myFolder = outAccount.Session.GetDefaultFolder(6)
Set myitem= myFolfer.items.Restrict("[UnRead]=True").GetFirst     
Need Help and my attchment filetype =.rsp
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • 1
    Need help with *what* exactly? What is it you're having a problem with? Don't rely on us figuring that out from the title alone. – Tim Williams Jun 17 '22 at 23:18
  • I edited the tags because this has nothing to do with UFT, it's pure VBScript. – Motti Jun 19 '22 at 07:23

1 Answers1

0

Check myitem.Attachments.Count > 0

If you need to check that there is an attachment with a particular extension, loop through the myitem.Attachments collection and for each Attachment object, check the Attachment.FileName property.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78