G Scott
asked on
VBA to Lotus Notes Calendar entry issue
Hello,
I found some code on EE that works great with one small exception. Each time I click the button to add the calendar entry it prompts me for my email password. Is there any way to code that in? Here is the code I found:
Thanks for any help you can give me.
I found some code on EE that works great with one small exception. Each time I click the button to add the calendar entry it prompts me for my email password. Is there any way to code that in? Here is the code I found:
Const Subject = "September staff meeting (Tuesday the ninth)"
Const position = "9/9/2009 10:00 AM"
Dim s As New NotesSession
s.Initialize
Dim dir As NotesDbDirectory
Dim db As NotesDatabase
Set dir = s.GetDbDirectory("")
Set db = dir.OpenMailDatabase
MsgBox db.Title & " on " & db.Server, , db.FilePath
Dim doc As Object 'notesDocument
Set doc = db.createDocument
doc.replaceItemvalue "Form", "Appointment"
Dim dateTime As Object 'NotesDateTime
Set dateTime = s.createDateTime(position)
doc.replaceItemvalue "$Alarm", 1
doc.replaceItemvalue "$AlarmOffset", 0
MsgBox "Setting reminder/alarm - " & dateTime.lslocalTime & " - " & Subject
doc.replaceItemvalue "startDateTime", dateTime
doc.replaceItemvalue "endDateTime", dateTime
doc.replaceItemvalue "calendarDateTime", dateTime
doc.replaceItemvalue "Subject", Subject
doc.replaceItemvalue "startTime", dateTime
doc.replaceItemvalue "appointmentType", "3"
doc.replaceItemvalue "Alarms", "1"
doc.replaceItemvalue "startDate", dateTime
doc.replaceItemvalue "endDate", dateTime
doc.replaceItemvalue "endTime", dateTime
doc.Save True, True
doc.putInFolder "($Alarms)"
Thanks for any help you can give me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! That worked great!!
ASKER
One interesting thing about that code maybe someone can help. When I click on it on my calendar it says "Error trying to open document: Note item not found" AND it does't get replicated. Any thoughts?
About the error: no clue at all... You could try to run the debugger to find out where the error comes from.
The document isn't replicated? There isn't a replication formula present for the database? No Readers fields in the document? Then it *should* replicate...
The document isn't replicated? There isn't a replication formula present for the database? No Readers fields in the document? Then it *should* replicate...
ASKER
How exacly do you modify the Initialize to include the password?? Sorry, kinda new to VBA.