Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Outlook with vbscript

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I am trying to write a vbscript that opens Outlook on my PC, creates a message and then sends it. For some reason although the Outlook process is open I can't see Outlook on my screen.

The script also generates a word document and with this I was able to use the code:

Set objWord = CreateObject("Word.Application")
objWord.Visible = True

However when I try

Set objOutlook = CreateObject("Outlook.Application")
objOutlook.Visible = True

I get the error:

Object doesn't support this property or method: 'objOutlook.Visible'
 
Try something like:

Code:
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
objNamespace.Logon "Default Outlook Profile",, False, True    
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
objFolder.Display

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top