ardman Posted January 11, 2006 Posted January 11, 2006 Hi, I'm creating a service that connects to Outlook 2003. I'm getting a problem when I start the service and it tries to connect to the Exchange Server. When I debug it, it works everytime. When I start it as a service, it fails every time. I know that the code is correct as it lets me connect when debugging. Please can anyone help or at least shed some light on this? Quote
Administrators PlausiblyDamp Posted January 11, 2006 Administrators Posted January 11, 2006 What user account is the service running as? Does this account have access to the Exchange server? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ardman Posted January 17, 2006 Author Posted January 17, 2006 What user account is the service running as? Does this account have access to the Exchange server? I'm using my own log in which has an Exchange Account. It is connecting correctly to the account and even works when I try and debug it, but it seems to fail when it tries to get the sender email address. Private objMessage As Outlook.MailItem Public Sub ProcessEmails() [indent]objMessage = objFolder.Items(1)[/indent] [indent]'Get the sender email address[/indent] [indent]Dim strSender As String = objMessage.SenderEmailAddress[/indent] [indent]'rest of the sub ....[/indent] End Sub It fails on the Dim strSender line. It sets the message object correctly, but as soon as it does anything else with objMessage it fails completely. Any ideas? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.