|
-
Oct 3rd, 2000, 05:04 AM
#1
Thread Starter
New Member
I'm trying to enter an appiontment into Outlook, for the default user, with the following code -
Public Sub gnlAddBirthday(ByVal strKidsName, ByVal dteBirthday)
Dim olAppt As outlook.AppointmentItem
Dim strDate As String
Dim strYear As String
Dim strBDate As String
Dim strBRest As String
Dim strBirthday As String
Dim winHwnd As Long
Dim boolOpened As Boolean
boolOpened = False
Screen.MousePointer = vbHourglass
Set olApp = New outlook.Application
Set olNameSpace = olApp.GetNamespace("MAPI")
olNameSpace.Logoff
olNameSpace.Logon
Set olRecipient = olNameSpace.CreateRecipient(olNameSpace.CurrentUser.Name)
Set olAppt = olNameSpace.GetSharedDefaultFolder(olRecipient, olFolderCalendar).Items.Add
With olAppt
.Subject = strKidsName + "'s Birthday"
.Body = "It's " + strKidsName + "'s Birthday today"
strDate = CDate(Date)
strYear = Right(strDate, 2)
strBDate = CDate(dteBirthday)
strBRest = Left(strBDate, 6)
strBirthday = strBRest + strYear
.Start = CDate(strBirthday + " 08:00 AM")
.End = CDate(strBirthday + " 08:01 AM")
.ReminderMinutesBeforeStart = "15"
.ReminderPlaySound = True
.Save
End With
Set olAppt = Nothing
Screen.MousePointer = vbDefault
End Sub
Can somebody please tell me what is wrong with this!!
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
|