With LotusScript you can interact with almost any element you include in the design of the database. From a technical point of view, creating documents is a trivial matter. From a programming point of view, that depends more on where the code is triggered, and what info do you need to fill the document with.
You refer to adding docs and using the Address book. Do you mean adding a new address when you receive a mail, or importing data from a different application (like, wild guess, Outlook) ?
It's from an excel-file with names and addresses. But not every address has to be imported. I have to check before I add the address to the addressbook.
I have following script:
Sub Click(Source As Button)
'Declare variables
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As notesDocument
'Initialize variables
Set db = session.Getdatabase("","names"
'names=Local AddressBook
Set doc = db.CreateDocument()
doc.Firstname = "dummy with script"
doc.Lastname="lastname dummy with script"
doc.IsSummary=True
Call doc.Save(True, False)
End Sub
Everything seems to go fine, I mean, there are no errors given, but when I look into my addressbook there are no new documents.
When I test on the items first like the following:
if doc.hasItem("Firstname" Then
Messagebox("firstname found"
End If
The messagebox is never displayed. How does Notes know that the document has to be created in the view "Contact".
Indeed, you will see no new contacts because, although you have created a document and saved it, you have not told Notes that the document you created was a contact. Notes does not "know" you are creating a contact. Notes is just doing what you tell it to do ;-).
To do so, you must add another line in your code :
doc.form="Person"
Doing that will ensure that you will see the document in the Contact view.
Always specify what type of doc it is when you create one programmatically.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.