Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Display Notes Email from MS Access

Posted on 2009-07-09
4
Medium Priority
?
254 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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