Group:  Microsoft Access » microsoft.public.access.modulescoding
Thread: Help with this code

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Help with this code
"SF" <ssamnang[ at ]yahoo.com> 23.02.2006 09:27:17
Dim oApp As outlook.Application
Dim oMsg As outlook.MailItem

Set oApp = New outlook.MailItem
Set oMsg = CreateItem(oMailItem)

With oMsg
.To = "ssamnang[ at ]yahoo.com"
.Subject = "cmd Buttom Testing..."
.Body = "Hey delete me now"
.Send
End With


at the very first line, I got the following error:

Compile Error:
User-Defined type not defined

SF


Re: Help with this code
Mattias Jonsson <news[ at ]ett-remove-idesystem.se> 23.02.2006 12:03:26
You have to add Outlook to your references. In the VBA window's menu,
under "Tools/References", check "Microsoft Outlook n.nn Object Library".

Or, to make it work without the reference, check this out this example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaol10/html/olmthItem.asp

Good luck
Mattias

From: SF, on 2/23/2006 4:27 AM:
[Quoted Text]
> Dim oApp As outlook.Application
> Dim oMsg As outlook.MailItem
>
> Set oApp = New outlook.MailItem
> Set oMsg = CreateItem(oMailItem)
>
> With oMsg
> .To = "ssamnang[ at ]yahoo.com"
> .Subject = "cmd Buttom Testing..."
> .Body = "Hey delete me now"
> .Send
> End With
>
>
> at the very first line, I got the following error:
>
> Compile Error:
> User-Defined type not defined
>
> SF
Re: Help with this code
"Luká¹ Kyzlink" <lukas.kyzlink[ at ]cesketelekomunikace.cz> 23.02.2006 15:16:27
Hello,

In Tools/References add MS Outlook 11.0 Object library. If error continues
then try this declaration:

Dim objOutlook As Object
Dim objItem As Object
'Create a Microsoft Outlook object.
Set objOutlook = CreateObject("Outlook.Application")
'Create and open a new contact form for input.
Set objItem = objOutlook.CreateItem(olContactItem)

happy coddin' (buddy*)lukas kyzlink

"SF" <ssamnang[ at ]yahoo.com> pí¹e v diskusním pøíspìvku
news:eU4eoqFOGHA.3936[ at ]TK2MSFTNGP12.phx.gbl...
[Quoted Text]
> Dim oApp As outlook.Application
> Dim oMsg As outlook.MailItem
>
> Set oApp = New outlook.MailItem
> Set oMsg = CreateItem(oMailItem)
>
> With oMsg
> .To = "ssamnang[ at ]yahoo.com"
> .Subject = "cmd Buttom Testing..."
> .Body = "Hey delete me now"
> .Send
> End With
>
>
> at the very first line, I got the following error:
>
> Compile Error:
> User-Defined type not defined
>
> SF
>


Re: Help with this code
"Luká¹ Kyzlink" <lukas.kyzlink[ at ]cesketelekomunikace.cz> 23.02.2006 15:29:51
Btw, This is the code that works correctly:

Dim olApp As outlook.Application
Dim olMsg As outlook.MailItem

Set olApp = CreateObject("Outlook.Application")
Set olMsg = CreateItem(olMailItem)

With olMsg
.Subject = "hello"
.Body = "that's just buddy"
.To = emailAddress
.Display
End With

(buddy*)lukas kyzlink

"SF" <ssamnang[ at ]yahoo.com> pí¹e v diskusním pøíspìvku
news:eU4eoqFOGHA.3936[ at ]TK2MSFTNGP12.phx.gbl...
[Quoted Text]
> Dim oApp As outlook.Application
> Dim oMsg As outlook.MailItem
>
> Set oApp = New outlook.MailItem
> Set oMsg = CreateItem(oMailItem)
>
> With oMsg
> .To = "ssamnang[ at ]yahoo.com"
> .Subject = "cmd Buttom Testing..."
> .Body = "Hey delete me now"
> .Send
> End With
>
>
> at the very first line, I got the following error:
>
> Compile Error:
> User-Defined type not defined
>
> SF
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net