0

I want to send email using outlook 2010, windows 7 & IE8 , what is code required to get the "Outlook.Application" object?.

I tried with :

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)

but getting "Object Required" error.

  • possible duplicate of [Opening outlook 2010 through vbscript](http://stackoverflow.com/questions/9391849/opening-outlook-2010-through-vbscript) – crashmstr Aug 24 '15 at 19:40

2 Answers2

0

"Object required" is vbscript's way of telling you that you tried to call a method of something which isn't an object, most likely it's NULL (or Nothing). The only object you're working with is objOutlook so probably CreateObject failed. Check to be sure that Outlook is registered correctly (The following registry key should exist HKEY_CLASSES_ROOT\Outlook.Application\CLSID).

Another problem may be if you have a 64 bit version of office installed, since QTP is a 32 bit application it can't create 32 bit objects (as explained here), although that refers to InprocServer s, I'm not sure if it applies to LocalServer s

Community
  • 1
  • 1
Motti
  • 110,860
  • 49
  • 189
  • 262
0

You should probably be using something like CDO.

Sending Emails Using CDO in WSH

Nilpo
  • 4,675
  • 1
  • 25
  • 39