|
|
|
|
|
|
|
|
|
|
How to make Lotus Notes and Microsoft Outlook/Exchange work together seamlessly (continued)
Let's make sure a default view was found.
If ViewID = "" Then
Msgbox "This database does not contain a default view." & Chr$(10) & Chr$(10) & "Please contact your database manager!", 4112, "Default View Not Found"
Exit Sub
End If
|
Let's create the NoteID, hint server, and file name for the link.
NoteID = "<NOTE OF" & Left$(docID, 8) &":"&Mid$(docID, 9, 8)&"-"&"ON"&Mid$(docID, 17, 8)&":"&Right$(docID, 8)&">"
HintServer = "<HINT>"& db.server &"</HINT>"
fileNum% = Freefile()
fileName$ = "c:\calendar.ndl"
|
Now we'll build the link file.
Open fileName$ For Output As fileNum%
Write #fileNum%, "<NDL>"
Write #fileNum%, ReplicaID
Write #fileNum%, HintServer
Write #fileNum%, ViewID
Write #fileNum%, NoteID
Write #fileNum%, "</NDL>"
Close fileNum%
|
You should call routine to create the calendar entry.
Call addcalendar()
End Sub
|
Okay, you have your doclink file. Now let's create the Outlook Calendar Entry and add the link you created from the above sub and some information from a couple of fields.
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
|
Get a handle on the current Lotus Notes Document.
Set uidoc = ws.Currentdocument
Set doc = uidoc.document
' Get Document Fields
Startdt = uidoc.FieldGetText("Start")
Enddt = uidoc.FieldGetText("end")
Body = uidoc.FieldGetText("desc")
Subject = uidoc.FieldGetText("appSubject")
|
Let's create the Outlook object.
Set appOutl = CreateObject("Outlook.Application")
Set myNameSpace = appOutl.GetNameSpace("MAPI")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(1)
|
Set your Appointment fields from the variables set above.
With myItem
.Start = Startdt
.End = Enddt
.Body = Chr$(10) & Chr$(10) & Body
.Subject = Subject
' Add the link we created in the initialize event!
With .attachments.Add("C:\calendar.ndl", 1, 1, "calendar.ndl")
End With
|
Display the appointment to the user. If you want this done in the back end (hidden), omit the next line.
Now close the object references.
Set appOutl = Nothing
Set myItem = Nothing
|
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
2-Minute Tutorials
How do I...
- integrate MS Office or OpenOffice with Notes?
- create cross-tab reports and charts?
- print serial letters and mailing labels?
- create PDFs in Lotus Notes?
Check out the 2-minute tutorials here. |
-- Advertisement --
The Ultimate Notes Domino Training Experience - Amsterdam, 11-13 November
Get in-depth technical training that you can put to use on the job right away at THE VIEW's Admin2008 and Lotus Developer2008 Europe! One registration gets you into your choice of over 70 new and updated expert know-how sessions, one-on-one consultations, hands-on labs, and more.
See complete agendas and register by 10 October to save 495 euros! |
|
|
|
|
|
|
|
|