473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing Logon Method in CDO

I want to access via CDO outlook.
Therfore i have to logon.
In VB.NEt I make it like:

Dim objSession As MAPI.Session
If objSession Is Nothing Then
objSession = CreateObject("MAPI.Session")
End If
If Not objSession Is Nothing Then
objSession.Logon(profileName:="Outlook", _
ShowDialog:=True)
End If

The point are parameters in method Logon. In VB i set only
2 parameters.
But in C# the compiler throws an error.
code in C#:

MAPI.Session session = new MAPI.Session();
session.Logon("Outlook");

Logon Method expects 7 parameters.
How can i invoke Logon-Method with 1 parameter ?
Does anyone know a solution ?

Nov 15 '05 #1
1 5187
Manfred,

For the other parameters, do this:

// Store the missing value.
object pobjMissing = System.Reflection.Missing.Value;

// Pass the missing value for everything else.
objSession.Logon("Outlook", pobjMissing, pobjMissing, pobjMissing, ...

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Manfred" <ma**************@astonit.com> wrote in message
news:0b****************************@phx.gbl...
I want to access via CDO outlook.
Therfore i have to logon.
In VB.NEt I make it like:

Dim objSession As MAPI.Session
If objSession Is Nothing Then
objSession = CreateObject("MAPI.Session")
End If
If Not objSession Is Nothing Then
objSession.Logon(profileName:="Outlook", _
ShowDialog:=True)
End If

The point are parameters in method Logon. In VB i set only
2 parameters.
But in C# the compiler throws an error.
code in C#:

MAPI.Session session = new MAPI.Session();
session.Logon("Outlook");

Logon Method expects 7 parameters.
How can i invoke Logon-Method with 1 parameter ?
Does anyone know a solution ?

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1899
by: Arun T M | last post by:
I have a Windows Service written in VB .NET which connects to an Exchange Server and accesses the messages in the Public Folders. I am using Collaborative Data Objects to do this. When I run the...
36
16316
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
0
2242
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
3
7156
by: Steve Lloyd | last post by:
Hi, I am trying to get someones email address out of the win 2003 server Directory using there logon name and the following code. Dim DSEntry As New...
5
2782
by: Khalique | last post by:
Hi everyone, I Hope that someone will be able to give me a hint to the solution to my problem. I have developed a web service (vb.net) that needs to access the folders / files and copy files to...
4
3739
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
8
13000
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide...
0
1026
by: Tony Girgenti | last post by:
Hello. Using VS .NET 2003 VB I used the walkthrough "Accessing an XML Web Service Using Visual Basic or Visual C#" VB version to create my own project. The code supplied uses the Try/Catch...
6
3703
by: Mr Flibble | last post by:
I have a class that has a LogOn method. I'm trying to think what the advantages are two approaches I have. a) Having a bool returned containing the success of the LogOn. b) Raising an...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.