|
-
Dec 28th, 2002, 06:46 PM
#1
Thread Starter
Hyperactive Member
OutlookMailItem.Send doesn't work in VB.Net - RESOLVED
Is there a reason why in VB6, this will work:
Code:
Dim olMail as Outlook.MailItem
.
.
.
olMail.Send
but in VB.Net you get the following error message:
Code:
"'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and 'Outlook.ItemEvents_Event'"
??
if so, can someone please show me how to press the "send" button???
thanks....
Last edited by stingrae; Dec 28th, 2002 at 09:16 PM.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Dec 28th, 2002, 09:15 PM
#2
Thread Starter
Hyperactive Member
After looking at microsoft.com for hours, i searched the msdn help on my local pc. low and behold:
Code:
Visual Basic Reference Error Messages
<membername>' is ambiguous across the inherited interfaces '<interfacename1>' and '<interfacename2>'See Also
Interfaces Overview
The interface inherits two or more members with the same name from multiple interfaces.
To correct this error
Cast the value to the base interface that you want to use; for example:
Interface Left
Sub MySub()
End Interface
Interface Right
Sub MySub()
End Interface
Interface LeftRight
Inherits Left, Right
End Interface
Module test
Sub Main()
Dim x As LeftRight
' x.MySub() 'x is ambiguous.
CType(x, Left).MySub() ' Cast to base type.
CType(x, Right).MySub() ' Call the other base type.
End Sub
End Module
so therefore the answer to my question is:
Code:
CType(olMail, Outlook._MailItem).Send()
learn something new everyday!
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|