Type mismatch: 'CreateItem'

L

Lynn

when i try to run this script it says:
c:\run.vbs(7, 1) Microsoft VBScript runtime error: Type mismatch:
'CreateItem'

Set myOlApp = CreateObject("Outlook.Application")
myItem = CreateItem(olMailItem)
Set myReply = myItem.Actions("Reply").Execute

can i know where is wrong? thanks
 
L

losmac

Set myOlApp = CreateObject("Outlook.Application") 'ok
myItem = CreateItem(olMailItem) 'it's not ok
'Set myItem = myOlApp.CreateItem(olMailItem) 'ok,
Set myReply = myItem.Actions("Reply").Execute 'ok

for more information: www.outlookvba.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top