Solved

Display Notes Email from MS Access

Posted on 2009-07-09
4
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

732 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