|
|
|
|
|
|
|
|
|
|
|
|
|
|
Getting inside the code of the automated signature generator (continued)
Line 01 is where the program determines, via the buildnumber, that an R5 client is in use. Build 166 is Notes 5.
What we then do, lines 04 through 11, is create a file in the Notes data directory called MailSigTemplateHTML.htm, and in line 10, write a single record to it containing the HTML template text from the HTMLTemplate field.
Next, in line 14, the routine creates a new document in the database and in line 15 makes that a public access document.
In lines 16 to 18, the routine creates an embedded object link pointing to the HTML file we just saved, and then in line 19, activates that OLE. That is then handed over to Windows, which will then do its thing on the HTML file, which, unless you have your Windows set up rather oddly, will open your default browser to render and display the HTML. Rendering the HTML signature block in the main SignatureForm is done in exactly the same way.
But what happens when you press the "I Like it" button? Here's the code for that HTML version of that -- the text version differs only by the values that are set in the mail profile.
01 Sub Click(Source As Button)
02 Dim sess As New NotesSession
03 Dim clientnab As New notesdatabase("","names.nsf")
04 Dim thisloc As NotesDocument
05 Dim wk As New notesuiworkspace
06 Dim uidoc As NotesUIDocument
07
08 'get Location from Environment. Use it to get the current location document
09 location = sess.getenvironmentstring("Location", True)
10 i = Instr(location,",")
11 j = Instr(i+1,location,",")
12 locID = Mid(location,i+1,j-(i+1))
13 Set thisloc = clientnab.getdocumentbyid(locID)
14 'check if the location is online - if offline we can't do this
15 If thisloc Is Nothing Then
16 Msgbox "Cannot find the location document for the current location (weird,
17 means that your Notes setup is Baaad!)"
18 Else
19 If thisloc.locationtype(0) <> "0" Then
20 Msgbox "Current location is not a LAN connected location; the profile in
21your local mail file will be updated. Remember to replicate it with the server sometime
22soon. And note the caveat about Notes data directory locations.",64,"Local Location"
23 End If
24 'write the HTML as a file in the Notes data directory
25 Set uidoc = wk.CurrentDocument
26 Dim fileNum As Integer
27 fileNum% = Freefile()
28 NotesDataDir = sess.getenvironmentstring("Directory", True)
29 HTMLFile = NotesDataDir & "\MailSigHTML.htm"
30 Open HTMLFile For Output As fileNum%
31 Print #fileNum%, Uidoc.fieldgettext("HTMLCreated")
32 Close #filenum
33 'go get the mail file and update the profile
34 Dim maildb As New NotesDatabase("","")
35 Call maildb.openmail 'should open the mail based on the current location
36
37 If maildb.IsOpen Then
38 Dim profdoc As notesdocument
39 Set profdoc = maildb.getprofiledocument("CalendarProfile")
40 If profdoc Is Nothing Then
41 Msgbox "No Profile Document in your mail database. Create one with
42Tools/Preferences and then do this action again."
43 Else
44 profdoc.enablesignature = "1" 'autosignature
45 profdoc.signatureoption = "2" 'via HTML file
46 profdoc.signature_2 = HTMLFile
47 profdoc.signature = HTMLFile
48 Call profdoc.save(True, False)
49 Msgbox "Mail Profile updated to use your new signature file."
50 End If
51 Else
52 Msgbox "Can't open the mailfile specified in your current location -- could
53there be a case sensitivity issue on the filename in your location vs the server?"
54 End If
55
56
57
58 End If 'no location
59 End Sub
60
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|