|
|
|
|
|
|
|
|
|
|
|
|
|
|
How to make Lotus Notes and Microsoft Outlook/Exchange work together seamlessly (continued)
There have been a few examples of sending Outlook Mail with a doclink around some of the discussions, so I'll write an example that adds an Outlook Calendar Entry with Lotus Notes Document field data, and a link back to the document. Please keep in mind that the field names I refer to are the fields in my sample application.
A Lotus Notes doclink contains all the information you need to find the document across your network. This is the content of a Lotus Notes doclink:
<NDL>
<REPLICA 8525681F:0043D9C5>
<VIEW OFAA9D6A37:688AF3AB-ON8525681F:0043DA1C>
<NOTE OFF2AC8FF6:29F86386-ON8525681F:00484A80>
<REM>Database 'Outlook MS Office Automation', View 'Main', Document 'This is the subject'</REM>
</NDL>
|
You can right click your mouse on a Lotus Notes document, select Copy as Link, and paste it into Notepad. Save it as filename.ndl, and use the file as a Lotus Notes doclink from any Windows application.
This is how you would build a doclink in that format with LotusScript:
Sub Initialize
' Declare all the Notes variables
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession '
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim docID As String
Dim ReplicaID As String
Dim HintServer As String
Dim ViewID As String
Dim NoteID As String
Dim Sto As String
Dim Cto As String
Dim Subject As String
Dim addsub As String
Dim Body As String
Dim addbody As String
|
Now get a handle on the current Lotus Notes document.
Set db = session.CurrentDatabase
Set uidoc = ws.Currentdocument
Set doc = uidoc.document
|
The document must first be saved. Let's check.
If doc.IsNewNote Then
Msgbox "This document has not been saved." & Chr$(10) & Chr$(10) & "Please save prior to mailing link!", 4112, "New Document"
Exit Sub
Else
' Lets get the documents ID
docID = doc.UniversalID
End If
|
The links to a local database won't work. Let's find out why.
If db.server = "" Then
Msgbox "You are not allowed to send a link of a local database", 4112, "Local Links Not Allowed"
Exit Sub
Else
|
Now create a replica line for the link.
ReplicaID="<REPLICA " & Left$(db.ReplicaID, 8) & ":" & Right$(db.ReplicaID, 8) & ">"
End If
ViewID = ""
|
You'll need a default view in the database for the link to work. Let's check for one.
Forall x In db.Views
If x.IsDefaultView Then
|
Now build a view line for the link.
ViewID = "<VIEW OF" & Left$(x.UniversalID, 8) &":"&Mid$(x.UniversalID, 9, 8)&"-"&"ON"&Mid$(x.UniversalID, 17, 8)&":"&Right$(x.UniversalID, 8)&">"
Exit Forall
End If
End Forall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|