In Lotus Notes, Create a View with only Send & Inbox mails - lotus-notes

I want to create a view in lotus Notes 8.5 with only mails in Send (view) and inbox (folder).
I try to custom formula
SELECT ( #IsNotMember("A"; ExcludeFromView) & IsMailStationery != 1 &
Form != "Group" & Form != "Person" ) &
!( DeliveredDate = "" & PostedDate != "" & !(#IsMember("S"; ExcludeFromView)) )
from Lotus Notes custom view received mail
or
How to Identify the Document is in Inbox/Draft/Sent in Lotus Notes Using Notes API?
and integrate #WhichFolders but without success.

Related

Searching outlook folder BY attachment filename

I am currently using Outlook 2010 and I am currently able to manually search a folder in outlook by using the "More" button and adding attachments:yes and attachment contains: where I input the filename to find an email and get the timestamp from when it was sent. I have thousands of attachments for which I need to do this and I would like to automate the process but I am an outlook vba noobie and I do not know the command to perform the search by attachment name, I have tried googling this but to no avail any help would be greatly appreciated thanks!
You can use Restrict https://msdn.microsoft.com/en-us/library/office/ff869597.aspx
Example here: http://www.jpsoftwaretech.com/save-all-attachments-from-selected-folder/
Set newItems = itms.Restrict("[Attachment] > 0")
Combined with:
attName = MsgAttach.Item(attachmentNumber)
If InStr(attName, "search string here") Then
Debug.Print "- " & attName
End If
Outlook Object Model will not let you search for an item with a particular attachment file name. You can explicitly loop through all items in the folder and check the attachment filename, but that will be highly inefficient.
On the Extended MAPI level (C++ or Delphi) you can create a subrestriction on the attachments. If using Redemption is an option (I am its author), it allows to specify Attachments in RDOItems.Find/Restrict:
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set vFolder = Session.GetFolderFromID(Application.ActiveExplorer.CurrentFolder.EntryID)
set vItems = vFolder.Items
set vMsg = vItems.Find("Attachments LIKE '%.zip%' ")
while not (vMsg Is Nothing)
MsgBox vMsg.Subject
set vMsg = vItems.FindNext
wend

Lotus Notes: Add clickable telephone number to mail

In lotus notes i have a script agent that auto generate mails and send it.
In the body of these mails i put lots of data among which some telephone numbers that i want they will be clickable from devices. How can i do this ?
Here the code that i use:
notebody="People:" & doc.people(0) & chr(10) & Cstr(doc.date(0)) & "Phone Number:"& doc.phone(0)
Set rtItem = New NotesRichTextItem(Maildoc , "Body" )
Call rtItem.AppendText(notebody)
The field that i want will be clickable is doc.phone(0). How can i do ? thank's
'First, see here: Answer to 'Is there a way to make a phone number clickable...'
In order to adapt that answer to a Notes agent that is using the rich text classes to generate a message, you would need to use pass-thru HTML. You can do this simply by surrounding the HTML fragment with '[' and ']' characters.
I.e., something like this:
notebody="People:" & doc.people(0) & chr(10) & Cstr(doc.date(0)) & |Phone Number: [| & doc.phone(0) & "]"
Note: not tested! I used the | char as the alternate for quotation marks in order to avoid escaping, and I checked carefully for typos, but...

Parsing appointments from shared Outlook calendars

I am trying to create an anonymized schedule for the conference rooms on our floor via Excel VBA.
The source data is stored in different Outlook calendars (every room has its own) and I got access to them via the "shared calendar" functionality of Outlook.
The problem I am currently having is fully automating the data retrieval process. I got everything else working fine, however, it requires the user to manually select the (currently) five different calendars from a small pop-up window, which is rather tiresome.
I have tried using the GetDefaultFolder(olFolderCalendar).Items approach, but this only seems to work for the local calendar not shared ones from the network (Exchange).
Is there a way to address these room calendars directly so that I can automate my process?
best regards,
daZza
Here's my current code, cut down to the relevant parts:
Set olNS = olApp.GetNamespace("MAPI")
For x = 1 To 5
Set myCalItems = olNS.PickFolder.Items
With myCalItems
.Sort "[Start]", False
.IncludeRecurrences = True
End With
StringToCheck = "[Start] >= " & Quote(StartDate & " 12:00 AM") & " AND [End] <= " & Quote(EndDate & " 11:59 PM")
Set ItemstoCheck = myCalItems.Restrict(StringToCheck)
' Do stuff with every item in "ItemstoCheck"
' ...
' ...
' ...
Next
Have you looked into the Namespace.GetSharedDefaultFolder method?

Lotus Notes custom view received mail

I am using lotus notes 8.5.2 on windows 7. I would like to create a custom view that shows all emails EXCEPT sent mail. In other words it contains: INBOX & ALL FOLDERS.
Currently my ALL DOCUMENTS view has the following formula conditions: SELECT #IsNotMember("A"; ExcludeFromView) & IsMailStationery != 1 & Form != "Group" & Form != "Person"
The SENT view has the conditions: SELECT DeliveredDate = "" & PostedDate != "" & !(#IsMember("S"; ExcludeFromView))
My thinking is that I should be able to exclude the SENT conditions from the ALL DOCUMENT condition ?
Thanks a lot
Taking all the documents that aren't in the Sent view isn't quite right, because there are a few documents that aren't in the Sent view that are also excluded from the All Documents view. The logic you want is:
SELECT (in the All Documents view) AND NOT (in the Sent view)
So, first make a copy of All Documents. You're going to keep the selection formula from the All Documents view, and put & !( ) after it, like this:
SELECT ( #IsNotMember("A"; ExcludeFromView) & IsMailStationery != 1 & Form != "Group" & Form != "Person" ) & !( )
Now, just copy the selection formula from the Sent view and put it between those empty parens, so the result is this:
SELECT ( #IsNotMember("A"; ExcludeFromView) & IsMailStationery != 1 & Form != "Group" & Form != "Person" ) & !( DeliveredDate = "" & PostedDate != "" & !(#IsMember("S"; ExcludeFromView)) )

Control the behaviour of #ClientType formula in Lotus

I ran into an issue with the #ClientType formula in Lotus Notes. This formula should show the client type. From the Lotus help:
Returns "Notes" if the client type is a Lotus Notes client Returns
"Web" if the client type is a Web browser
#ClientType is useful within database formulas, form formulas, buttons
in forms, and "hide-when" formulas. Do not use #ClientType in column
formulas. #ClientType always returns "None" when executed in a server
background agent.
However if I run this code in an agent or action hotspot in the client:
x = Evaluate("#ClientType")
MsgBox x(0)
The result is "Web".
And if I use the notesDocument.RenderToRTItem( notesRichTextItem ) or notesDocument.ConvertToMIME( conversionType, options ) function, the #ClientType formula is also evaluated to "Web"
This is relevant because some fields in the document form in the document library use this formula in the hide when options. When a document is rendered to rich text or to MIME, this field is not included.
Is there any way to control the behavior of this formula? My only other option is to change the hide when formula's, but I would rather leave the design of the database as is.
Even though it's working on a computed field, if your agent gets that document handle then you can get from the computed field. Whereas it will not work in column formula which is already mentioned in help document.
It seems that the solution is to convert the session's convertmime flag to true after your doc.converttomime call
Code below is run from a scheduled agent.
Test 1 returns 'Nothing'
Test 2 returns 'Web'
Test 3 returns 'Nothing'
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim vntClientType As Variant
Set db=s.Currentdatabase
On Error GoTo ErrorHandling
vntClientType = Evaluate("#ClientType")
MessageBox " Test 1 before converttomime " & vntClientType(0)
Set doc=New NotesDocument(db)
Call doc.converttomime
vntClientType = Evaluate("#ClientType")
MessageBox " Test 2 after converttomime" & vntClientType(0)
s.convertmime=True
vntClientType = Evaluate("#ClientType")
MessageBox " Test 3 after s.convertmime= true" & vntClientType(0)
Exit Sub
ErrorHandling:
Error Err, Error & " - " & ", at line " & Erl & { in "} & GetThreadInfo( 1 ) & {"}
End Sub

Resources