We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


export email as a file?

jlymn asked
Medium Priority
Last Modified: 2013-12-18
I have an email that has lots of twisties containing other emails and pics etc

is there any way to export that email to a file so i can share it on a network drive?

Watch Question


guess I should have said, its notes7 i'm using!

Hi jlymn,
only as a picture file (jpeg, gif).

For the purpose of creating image of document the method
    flag = notesDocument.RenderToRTItem( notesRichTextItem )
is used.

Before calling that method call this one:
    Call notesUIDocument.ExpandAllSections
to expand all those twisties.

Hope this helps,



thanks for the link, do you know how i would implement the code? I've not done any notes development before. Do i just need basic notes package and to create a macro somehow?

you need Lotus Notes Client (which you obviously have since you read LN mail) and Lotus Domino Designer (to enter database design - code).
Do you have Domino Designer?

If yes:
Using BitBlt operations you can easily copy selected documents from a view as seperate Word documents.
Make sure you have a field called "Subject" in each document, or modify the call to the CopyScreenRectToWord parameters accordingly.
By default the size of the region is set to 600x600, starting from the corner of the Notes Document content, and you can change this size as needed.

Create an agent called CopyNotesDocumentToWordPicture, and put the agent target as "All Selected Documents":
Const SRCCOPY& = &HCC0020
Const CF_BITMAP& = 2
Declare Function GetFocus Lib "USER32" () As Long
Declare Function GetDC Lib "USER32" (Byval hWnd As Long) As Long
Declare Function DeleteDC Lib "GDI32" ( Byval hDC As Long) As Long
Declare Function ReleaseDC Lib "USER32" (Byval hWnd As Long, Byval hDC As Long) As Long
Declare Function CreateCompatibleDC Lib "GDI32" ( Byval hDC As Long) As Long
Declare Function CreateCompatibleBitmap Lib "GDI32" ( Byval hDC As Long, Byval nWidth As Long, Byval nHeight As Long) As Long
Declare Function SelectObject Lib "GDI32" ( Byval hDC As Long, Byval hObject As Long) As Long
Declare Function BitBlt Lib "GDI32" ( Byval hDCDest As Long, Byval XDest As Long, Byval YDest As Long, Byval nWidth As Long, Byval nHeight As Long, Byval hDCSrc As Long, Byval XSrc As Long, Byval YSrc As Long, Byval dwRop As Long) As Long
Declare Function OpenClipboard Lib "USER32" (Byval hWnd) As Long
Declare Function EmptyClipboard Lib "USER32" () As Long
Declare Function SetClipboardData Lib "USER32" (Byval wFormat As Long, Byval hMem As Long) As Long
Declare Function CloseClipboard Lib "USER32" () As Long
Dim appWord

Sub Initialize
    Set appWord = CreateObject("Word.Application")
    Dim workspace As New notesuiworkspace
    Dim uidoc As NotesUIDocument
    Dim session As New notessession
    Dim db As notesdatabase
    Dim col As notesdocumentcollection
    Dim doc As notesdocument
    Dim i As Long
    Set db=session.CurrentDatabase
    Set col=db.unprocesseddocuments
    Set doc=col.getfirstdocument
    While Not doc Is Nothing
        Set uidoc=workspace.EditDocument(True,doc)
        Call CopyScreenRectToWord(exportpath & doc.Subject(0), 0, 0, 600, 600)
        uidoc.Close True ' True=immediate close, needs Notes 5.0.7 or higher
        Set doc=col.getnextdocument(doc)

Hope this helps,

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Question, why not print to PDF?  check out pdf995.com for inexpensive pdf printing solution.  You can export to PDF, encrypt and even attach a password so the document can't be changed.


thanks, i'll try both these so i'll split the points
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.