Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1245
  • Last Modified:

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:

 
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)"

Open in new window


Thanks for any help you can give me.
0
G Scott
Asked:
G Scott
  • 3
  • 2
2 Solutions
 
Sjef BosmanGroupware ConsultantCommented:
AFAIK, two ways:
- you modify the Initialize to include your password
- you leave it as it is, and you select "Don't prompt for a password from other Notes-based programs" in the Notes security settings.

I hope I'm not too late... ;-)
0
 
G ScottAuthor Commented:
sjef bosman, nope you are not too late, in fact, I was hoping to hear from you since you may recognize the code. ;)  

How exacly do you modify the Initialize to include the password??  Sorry, kinda new to VBA.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
G ScottAuthor Commented:
Thanks! That worked great!!
0
 
G ScottAuthor Commented:
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?
0
 
Sjef BosmanGroupware ConsultantCommented:
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...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now