Home > Domino Tips > Administrator > Mail > Uncheck Icon Refresh Replace Design Via Script
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

MAIL

Uncheck Icon Refresh Replace Design Via Script


Michael Bohlken
03.26.2001
Rating: -3.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This script will uncheck the refresh/replace design updates box on the icon.

The next time the mail template changes, the design task will then replace all the icons to the one that is in the mail template. I added an agent to the "mail tools" download from notes.net. I also used a tip on how to access design elements, also on notes.net



Code

The DBDesign Script lib must be included (download the "LotusScript DatabaseDesign Class" from the sandbox and copy it. Then, download the "Mail File Tool". Add the following agent...

Option Public
Use "DBDesign"

Sub Initialize
Dim dbDir As New NotesDbDirectory( "" )
Dim agentlog As NotesLog
Dim count As Integer
Dim howmany As String
Dim session As New NotesSession
Dim state As String
Dim range As String

Set db = session.CurrentDatabase
Set agent = session.CurrentAgent
count = 0
Set agentlog = New NotesLog(agent.Name + " Agent in " + db.Title + " on " + db.Server )
Call agentlog.OpenNotesLog( db.Server , db.FilePath )
Call agentlog.LogAction(agent.Name + " Agent starting." )
Dim curdb As NotesDatabase
Dim level As Integer
Set curdb = dbDir.GetFirstDatabase(DATABASE)
While Not(curdb Is Nothing)
path$ = Ucase(curdb.FilePath)
pos = Instr(path$, "MAIL") 'Do not use or / due to different server types.
If pos = 1 Then
count = count + 1
On Error Goto processError
If curdb.DesignTemplateName = "" Then
Call agentlog.LogAction ( "DESIGN: " & Cstr(count) & " " & curdb.FileName & " has no inherit_design_from value.")
Else
Call agentlog.LogAction ( "DESIGN: " & Cstr(count) & " " & curdb.FileName & " " & curdb.DesignTemplateName )
End If
Call curdb.Open( "", "" )
level = curdb.CurrentAccessLevel

Print curdb.Title

If level < ACLLEVEL_EDITOR Then
Print Cstr(count) & " " & curdb.FileName & " " & curdb.Title & " skipped due to Access Level " & Cstr(level)
Call agentlog.LogAction ( "LISTMF: " & Cstr(count) & " " & curdb.FileName & " " & curdb.Title & " skipped due to Access Level " & Cstr(level))
Else
If curdb.IsOpen Then
Call UncheckIconReplaceRefresh(curdb, agentlog, count)
Call curdb.Close
End If
End If
End If
nextdb:
Set curdb = dbDir.GetNextDatabase
Wend
If count = 0 Then
howmany = "There were no mail file databases checked."
Else
If count = 1 Then
howmany = "One mail file database checked."
Else
howmany = "There were " & count & " mail file databases checked."
End If
End If
Call agentlog.LogAction ( howmany )
Call agentlog.LogAction(agent.Name + " Agent ending." )
Call agentlog.Close
Exit Sub
processError:
Call agentlog.LogAction ( curdb.Title & " raised error: " & Err() & ": " & Error())
Resume nextdb
End Sub

Sub UncheckIconReplaceRefresh(db As NotesDatabase, agentlog As NotesLog, count As Integer)
Dim dbdesign As DatabaseDesign
Set dbDesign = createDatabaseDesign( db)

Dim icons As Variant
Dim flagValue As String
Dim position As Integer

icons = dbdesign.iconDocuments
Forall i In icons
flagValue = i.getItemValue( "$Flags")(0)
position = Instr(1, flagValue, "R")
If position = 0 Then
flagValue = flagValue & "R"
Call i.ReplaceItemValue( "$Flags", flagValue )
Call i.Save( True, True )
Call agentlog.LogAction ( "ICON: " & Cstr(count) & {" Icon has been set to have design replaced.} )
Else
Call agentlog.LogAction ( "ICON: " & Cstr(count) & {" Replace design already set.} )
End If
End Forall
End Sub


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Mail
Run or restart Notes/Domino agents via text messages
How to create mail files using a LotusScript agent
How to turn off the message recall feature in Lotus Notes 8
Domino server setting and email policy tricks admins must know
Top 10 Lotus Notes/Domino administration tips of 2008
Understanding a Lotus Notes Smart Upgrade rollout
Bringing MailRule documents back into view
Use SMTP outbound authentication to relay hosts in Lotus Notes Domino 8
Notes/Domino 6 version of 'Discover Folder'
Five tips to improve email performance

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts