Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Email using Outlook

I have set up an excel book that when a button is pressed it auto emails the
saved book via Lotus Notes. I now need to do the same but via Outlook. I have
used the code associated with SendWithOutlook but I get an error message
straight off, on the line Dim objOL As New Outlook.Application. The error is
"Compile error: User-defined type not defined".

any ideas?

Sub SendWithOutlook()

Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Email using Outlook

Create a reference to the Outlook object model in tools- references in the
VBE or use late binding.

--
Regards,
Tom Ogilvy


"Paul Dennis" wrote:

I have set up an excel book that when a button is pressed it auto emails the
saved book via Lotus Notes. I now need to do the same but via Outlook. I have
used the code associated with SendWithOutlook but I get an error message
straight off, on the line Dim objOL As New Outlook.Application. The error is
"Compile error: User-defined type not defined".

any ideas?

Sub SendWithOutlook()

Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Email using Outlook

How do I make a reference? Is it a matter of ticking one of the options? if
so which one? You can guess I'm a novice at this.

"Tom Ogilvy" wrote:

Create a reference to the Outlook object model in tools- references in the
VBE or use late binding.

--
Regards,
Tom Ogilvy


"Paul Dennis" wrote:

I have set up an excel book that when a button is pressed it auto emails the
saved book via Lotus Notes. I now need to do the same but via Outlook. I have
used the code associated with SendWithOutlook but I get an error message
straight off, on the line Dim objOL As New Outlook.Application. The error is
"Compile error: User-defined type not defined".

any ideas?

Sub SendWithOutlook()

Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Email using Outlook

Yes. Look down the list until you find Microsoft Outlook and tick that.

--
Regards,
Tom Ogilvy


"Paul Dennis" wrote:

How do I make a reference? Is it a matter of ticking one of the options? if
so which one? You can guess I'm a novice at this.

"Tom Ogilvy" wrote:

Create a reference to the Outlook object model in tools- references in the
VBE or use late binding.

--
Regards,
Tom Ogilvy


"Paul Dennis" wrote:

I have set up an excel book that when a button is pressed it auto emails the
saved book via Lotus Notes. I now need to do the same but via Outlook. I have
used the code associated with SendWithOutlook but I get an error message
straight off, on the line Dim objOL As New Outlook.Application. The error is
"Compile error: User-defined type not defined".

any ideas?

Sub SendWithOutlook()

Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

  #5   Report Post  
Posted to microsoft.public.excel.programming
GK GK is offline
external usenet poster
 
Posts: 17
Default Email using Outlook

Hello,

I have the same problem, when I follow the suggestion at my MS Access,
Tool-reference, I am not able to locate "reference' menu item. I am using MS
Access 200 3 and Outlook 2003.

thanks.

"Paul Dennis" wrote:

I have set up an excel book that when a button is pressed it auto emails the
saved book via Lotus Notes. I now need to do the same but via Outlook. I have
used the code associated with SendWithOutlook but I get an error message
straight off, on the line Dim objOL As New Outlook.Application. The error is
"Compile error: User-defined type not defined".

any ideas?

Sub SendWithOutlook()

Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

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
How do I set up Outlook email? new at outlook set up New Users to Excel 2 March 5th 09 08:31 AM
Outlook Email Jame-O New Users to Excel 1 November 7th 06 05:53 PM
Outlook Email Nigel RS[_2_] Excel Programming 4 July 12th 06 12:41 PM
Email & Outlook Chris Excel Discussion (Misc queries) 0 March 14th 06 12:04 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM


All times are GMT +1. The time now is 10:24 AM.

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

About Us

"It's about Microsoft Excel"