Solved

Display Notes Email from MS Access

Posted on 2009-07-09
4
229 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
Comment Utility
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
Comment Utility
Wow!  Great.  Is there a way to open the email, but not put it in Edit mode?  Thanks, Hammer8
0
 

Author Comment

by:Hammer8
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now