Solved

VBA to Lotus Notes Calendar entry issue

Posted on 2010-11-12
6
1,242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

615 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