Solved

VBA to Lotus Notes Calendar entry issue

Posted on 2010-11-12
6
1,231 Views
Last Modified: 2013-11-27
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
Comment
Question by:G Scott
  • 3
  • 2
6 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 125 total points
ID: 34124462
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
 
LVL 1

Author Comment

by:G Scott
ID: 34124515
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
 
LVL 22

Assisted Solution

by:mbonaci
mbonaci earned 125 total points
ID: 34124610
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 1

Author Closing Comment

by:G Scott
ID: 34124658
Thanks! That worked great!!
0
 
LVL 1

Author Comment

by:G Scott
ID: 34124697
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
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34130404
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question