Solved

Display Notes Email from MS Access

Posted on 2009-07-09
4
233 Views
Last Modified: 2013-12-18
Hi, I am trying to search for a particular Lotus Notes email using the UniversalID of that email and once found, open/display that email in Notes using code in MS Access VBA.  Is this possible?  I cannot use LotusScript.  Thanks, Hammer8
0
Comment
Question by:Hammer8
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 500 total points
ID: 24814970
Sure,

Here's a function that you can use...
Public Sub OpenMemoByUnid(ByVal unid As String)
 
  ' open current user's email file
  Dim sess As Object, email As Object, doc As Object
  Set sess = CreateObject("Notes.NotesSession")
  Set email = sess.GetDatabase("", "")
  email.OpenMail
  
  ' get the document
  Set doc = email.GetDocumentByUNID(unid)
  If (doc Is Nothing) Then
    MsgBox ("Unable to locate the specified document!")
  Else
    Dim ws As Object
    Set ws = CreateObject("Notes.NotesUIWorkspace")
    Call ws.EditDocument(True, doc)
    Call AppActivate(ws.CurrentDocument.WindowTitle)
    
  End If
  
End Sub

Open in new window

0
 

Author Comment

by:Hammer8
ID: 24815257
Wow!  Great.  Is there a way to open the email, but not put it in Edit mode?  Thanks, Hammer8
0
 

Author Comment

by:Hammer8
ID: 24815509
I found it - chance true to false in EditDocument.  However, I sometimes get a run time error 5 on
Call AppActivate(ws.CurrentDocument.WindowTitle)

Appending " - IBM Lotus Notes" seems to help some, but still get the error?
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 24816020
I've never seen that function raise an error before.

You can either leave it out or tell VB to ignore the error by placing this line before the call to AppActivate.

    On Error Resume Next
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question