473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Error when logging into exchange account only in vb6 program, but not in outlook 2003

I have an error when trying to log into outlook accounts in my vb6 program. I do not have a problem logging into these same accounts using outlook 2003. I have googled and found most of the solutions refer to wsock32.dll is missing. I have a wsock32.dll file. And that also would not explain why I can log in to the accounts on our exchange server using outlook 2003.

Anyways, here is my code: (it is still rough, but I just want to get past this and I will clean it up later for all you experts...lol) I may have pinpointed it to the IPM.Appointment error. I have checked my books and that looks correct though.

Dim objSession As MAPI.Session
Dim objFolder As MAPI.Folder
Dim objMsgs As MAPI.Messages
Dim objMsg As MAPI.AppointmentItem
Dim objField As MAPI.Fields

Dim mar102007 As String
Dim mar112007 As String
Dim mar122007 As String
Dim nov32007 As String
Dim nov42007 As String
Dim nov52007 As String

Dim i As Long
Dim numChecked As Long
Dim temp As String
Dim Count As Long
Dim Subject As String
Dim location As String

Dim startDate As Date
Dim endDate As Date

Dim notes As String

mar102007 = "03/10/2007"
mar112007 = "03/11/2007"
mar122007 = "03/12/2007"
nov32007 = "11/03/2007"
nov42007 = "11/04/2007"
nov52007 = "11/05/2007"

On Error GoTo ErrorHandler

If Check4.Value <> 1 And Check5.Value <> 1 And Check6.Value <> 1 And Check7.Value <> 1 Then
MsgBox "You must check one of the check boxes of a year to the left to run this program"
Exit Sub

End If

Set objSession = New MAPI.Session

objSession.Logon 'must logon before you can use objSession
Set objFolder = objSession.GetDefaultFolder(CdoDefaultFolderCalend ar)
Set objMsgs = objFolder.Messages

If Check4.Value = 1 Then
Count = Count + 1
MsgBox "here"
'it appears that this is need before you make the event to add to outlook
objMsg.Type = "IPM.Appointment" 'this is erroring
objMsg.ConversationIndex = objSession.CreateConversationIndex
Set objMsg = objMsgs.Add

'mar 10, 2007 10 pm to mar 11, 2007 6 am

startDate = DateAdd("h", 22, mar102007)
endDate = DateAdd("h", 6, mar112007)

objMsg.Subject = "Regular event on March 10, 2007 from 10 pm to March 11, 2007 at 6 am"
objMsg.Text = "Here is some text"
objMsg.StartTime = startDate
objMsg.EndTime = endDate
objMsg.location = "This is the location field"
objMsg.ReminderSet = True
'set reminder 15 minutes before startDate
objMsg.ReminderMinutesBeforeStart = 15

Set objFields = objMsg.Fields
objMsg.Update True, True

DoEvents
End If

If Check5.Value = 1 Then
Count = Count + 1
End If

If Check6.Value = 1 Then
Count = Count + 1
End If

If Check7.Value = 1 Then
Count = Count + 1
End If

Cleanup:
MsgBox "enter exitsub"
Set objFields = Nothing
Set objMsg = Nothing
Set objMsgs = Nothing
Set objFolder = Nothing
If Not objSession Is Nothing Then
objSession.Logoff
Set objSession = Nothing
End If
MsgBox "exit exit sub"
GoTo AtEnd

ErrorHandler:
MsgBox "Error Handler"
MsgBox "Error Occurred: " & Err.Description & " [" & Err.Number & "]", vbOKOnly, "DSTMaker - Error"
GoTo Cleanup

AtEnd:
MsgBox "Done"
End Sub


Thanks for the help in advance
Jul 31 '07 #1
1 1594
fplesco
82
Hi twhitehouse -

I am not familiar with this but I think, you miss your Account ID and Password. You must be sending that too as parameters.
Aug 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sandy Beach | last post by:
Hi, I have an app, written in c#, that checks an email inbox (using cdo/mapi) and does some processing. I've written a function "WriteToLogFile (string text, bool onConsole)" that checks...
1
by: Arran Pearce | last post by:
I am wanting to create a web application which will use Microsoft Exchange Server. We currently use Exchange 2000 but if i needed it we would upgrade to 2003. Is 2003 going to provide easyer...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
0
by: Grahame | last post by:
Hi, I have an app, written in c#, that checks an email inbox (using cdo/mapi) and does some processing. I've written a function "WriteToLogFile (string text, bool onConsole)" that checks...
6
by: Boris Tabenkin | last post by:
Hi all, I want to apologize if this is the wrong forum for this question. I would like to write an application, in Java running on UNIX, that would insert, read, and mark as completed tasks in...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
1
by: Crash | last post by:
VS 2005 ..NET 2.0 Windows Tablet XP SP2 MS Outlook 2003 I have users on tablets that work mostly disconnected. I would like to ensure that my users are configured to each have an Outlook .PST...
0
by: rpriyams | last post by:
Hi all, Currently we are using redemption library to access outlook mailboxes. i am facing a problem while logging into exchange mailserver using LogonExchangeMailbox method of RDOSession. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.