Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


Martin Henke 8.Apr.10 06:10 AM a Web browser
General 7.0.3 FP1; 7.0.3; 7.0.2 FP3; 7.0.2 FP2; 7.0.2 FP1; 7.0.2; 7.0.1 FP1; 7.0.1; 7.0; 6.5.6; 6.5.5 FP3; 6.5.5 FP2; 6.5.5 FP1; 6.5.5; 6.5.4 FP3; 6.5.4 FP2; 6.5.4 FP1; 6.5.4; 6.5.3 FP2; 6.5.3 FP1; 6.5.3; 6.5.2 FP1; 6.5.2; 6.5.1 Windows Vista; Windows 2003; Windows 2000; Windows XP


Hello all,

what I want to do is to export a selected message to DXL.
Problem is that I want to export notesbitmaps as GIF.
As this can only be done with Domino.DxlExporter I wrote an agent which should do the export (as the feature ConvertNotesbitmapsToGIF is present there). My agent works, when calling it from the menu. However, if I call it from my program, I get reported that the agent was executed, but the export file is not there. If possible, I would like to avoid using an agent alltogether, and use the Domino.DxlExporter in my program. But then the difficulty is that I only get a Lotus.NOTESSESSION from the PostOpen script which I cannot use to create a Domino.DxlExporter...

Please find the agent, PostOpen and application source code below. The application is called from the PostOpen script.

Thank you for your help in advance!

Best regards,

Martin

*******************************
AGENT code:
*******************************

Sub Initialize
'On Error Goto ERRORHANDLER

Dim sTitle
Dim sServer
Dim sFilePath

Dim session As New NotesSession
Dim db As NotesDatabase
Dim dxlExporter As NotesDXLExporter
Dim dxlStream As NotesStream
Dim dlxContent As String
Dim uiWorkspace
Dim uiView
Dim message As NotesDocument

Set db = session.CurrentDatabase

sTitle = db.Title
sServer = db.Server
sFilePath = db.FilePath

Msgbox "Starting agent"
Set uiWorkspace = CreateObject("Notes.NotesUIWorkspace")
If Not uiWorkspace Is Nothing Then
Set uiView = uiWorkspace.CurrentView

If Not uiView Is Nothing Then
Set message = db.GetDocumentByID(uiView.CaretNoteID)
If Not message Is Nothing Then
Msgbox "Setting dxlStream"
Set dxlStream = session.CreateStream
Msgbox "Creating output file"
dxlStream.Open ("C:\ExportMail.dxl")
dxlStream.Truncate
Msgbox "Setting Exporter"
Set dxlExporter = session.CreateDXLExporter(message)
dxlExporter.ConvertNotesbitmapsToGIF=True
dxlExporter.OutputDOCTYPE=False
Msgbox "Exporting"
dlxContent = dxlExporter.Export
Msgbox "Writing text to file"
dxlStream.WriteText(dlxContent)
Msgbox "Closing Stream"
dxlStream.Close
Else
Msgbox "message is Nothing"
End If
Else
Msgbox "uiView is Nothing"
End If
Else
Msgbox "uiWorkspace is Nothing"
End If

Goto endofsub

ERRORHANDLER:
Msgbox "Error: " & Err & " - " & Error$ & Chr(10) & Chr(10) & "Line: " & Erl & Chr(10), 48, "osExportMailToDxl"
Resume EndOfSub

EndOfSub:

End Sub

*******************************
POSTOPEN script code:
*******************************

Dim oMyApp
Set oMyApp = CreateObject("MyApp.Application")
oMyApp.Init session, sServer, sFilePath
Set oMyApp = Nothing

*******************************
APPLICATION code (C#):
*******************************

public void Init(NOTESSESSION notesSession, string databaseServer, string databaseFilePath)
{
_notesSession = notesSession;
_databaseServer = databaseServer;
_databaseFilePath = databaseFilePath;
try
{
lotus.NOTESAGENT notesAgent;
lotus.NOTESDATABASE db;
db = (lotus.NOTESDATABASE)notesSession.CURRENTDATABASE;
notesAgent = (lotus.NOTESAGENT)db.GETAGENT("MyAgent");
notesAgent.RUN(HelpRoutines.Missing);
}
catch (Exception ex)
{
// Error logging
}
}






Exporting mail to DXL (Martin Henke 8.Apr.10)
. . RE: Exporting mail to DXL (Andre Guirard 8.Apr.10)
. . RE: Exporting mail to DXL (Martin Henke 13.Apr.10)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite