Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Late binding issue with Outlook mail item from XL

I'm trying to automate Outlook from XL to generate an email using LATE
BINDING. I have the following code so far, BUT it breaks when trying to
create a MailItem:

Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateObject("Outlook.MailItem")

Can someone please correct my code so this will run correctly?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Late binding issue with Outlook mail item from XL

Hi
Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateItem(olMailItem)

HTH
Cordially
Pascal


"XP" a écrit dans le message de news:
...
I'm trying to automate Outlook from XL to generate an email using LATE
BINDING. I have the following code so far, BUT it breaks when trying to
create a MailItem:

Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateObject("Outlook.MailItem")

Can someone please correct my code so this will run correctly?

Thanks much in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Late binding issue with Outlook mail item from XL

Thanks, but this method fails at the line:

Set oMAIL = oOL.CreateItem(olMailItem)

Any ideas?

"papou" wrote:

Hi
Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateItem(olMailItem)

HTH
Cordially
Pascal


"XP" a écrit dans le message de news:
...
I'm trying to automate Outlook from XL to generate an email using LATE
BINDING. I have the following code so far, BUT it breaks when trying to
create a MailItem:

Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateObject("Outlook.MailItem")

Can someone please correct my code so this will run correctly?

Thanks much in advance.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Late binding issue with Outlook mail item from XL

Open up Outlook.
Go to its VBE
Show the immediate window
and type:
?olMailItem

You'll see a number returned. Use that number instead of olMailItem.

You'll want to do this for any other outlook constant that you use in your code.

(and you'll have 0 errors <vbg.)
That was a hint.

XP wrote:

Thanks, but this method fails at the line:

Set oMAIL = oOL.CreateItem(olMailItem)

Any ideas?

"papou" wrote:

Hi
Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateItem(olMailItem)

HTH
Cordially
Pascal


"XP" a écrit dans le message de news:
...
I'm trying to automate Outlook from XL to generate an email using LATE
BINDING. I have the following code so far, BUT it breaks when trying to
create a MailItem:

Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateObject("Outlook.MailItem")

Can someone please correct my code so this will run correctly?

Thanks much in advance.





--

Dave Peterson
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Late binding issue with Outlook mail item from XL

See the examples in my Outlook macro's
http://www.rondebruin.nl/sendmail.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
I'm trying to automate Outlook from XL to generate an email using LATE
BINDING. I have the following code so far, BUT it breaks when trying to
create a MailItem:

Dim oOL As Object
Dim oMAIL As Object
Set oOL = CreateObject("Outlook.Application")
Set oMAIL = oOL.CreateObject("Outlook.MailItem")

Can someone please correct my code so this will run correctly?

Thanks much in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Late Binding with Outlook matelot Excel Programming 3 September 24th 06 02:00 AM
Late binding issues with Excel and Outlook Dave Benson Excel Programming 0 November 26th 05 03:00 AM
repost: need help trying to automate Outlook from XL, with late binding KR Excel Programming 5 January 6th 05 03:20 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM
Creating a MailItem in Outlook from Excel using Late Binding Steven Kelder Excel Programming 3 December 17th 03 05:34 PM


All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"