Search DominoPower's 11,425 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Quickr place Superusers
Writing Client-Side Javascript for Re-Use
Lotus Notes R8.5.1: Bug in Contacts "Print Selected View"
New Notes/Domino Technotes published about Chile's extended daylight saving time
SnnT: How to prevent Google from listing your Sametime Server
How to send someone an email that shows your calendar availability
"The collection has become invalid"
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login