-1

When I call NotesDXLExporterClass.Export on a NotesDocumentClass object that has a very large attachment, I get a System.Runtime.InteropServices.COMException: 'Out of memory' exception.

I was hoping to resolve this by setting NotesDXLExporter.OmitRichtextAttachments to true, but it looks like this property is not available through COM (1).

What are my options here to get around this issue?

(1) Differences between accessing Domino Objects through either LotusScript or COM

Note 4: NotesXMLProcessor is not implemented in COM. NotesDXLExporter and NotesDXLImporter implement ExitOnFirstFatalError, Log, and LogComment, rather than inheriting them. )

Edit:

When I open C:\Program Files (x86)\IBM\Lotus\Notes\domobj.tlb in Oleview.exe and look at the NotesDXLExporterClass interface I only see the following:

[
  uuid(29131437-2EED-1069-BF5D-00DD011186B7)
]
dispinterface NOTESDXLEXPORTER {
    properties:
        [id(0x00000bf6)        
]
        VARIANT FORCENOTEFORMAT;
        [id(0x00000bfa)        
]
        VARIANT OUTPUTDOCTYPE;
        [id(0x00000bfb)        
]
        BSTR DOCTYPESYSTEM;
        [id(0x00000f1e), readonly        
]
        BSTR LOG;
        [id(0x00000f1f)        
]
        BSTR LOGCOMMENT;
        [id(0x00000f20)        
]
        VARIANT EXITONFIRSTFATALERROR;
    methods:
        [id(0x00000f28)]
        void SETINPUT(VARIANT INPUT);
        [id(0x00000f29)]
        void SETOUTPUT(VARIANT OUTPUT);
        [id(0x00000f2a)]
        void PROCESS();
};

2 Answers2

0

The document to which you've linked (and also my local Notes Help) doesn't say that NotesDXLExporter.OmitRichtextAttachments isn't available in COM. Did you try using that property and get an error?

If NotesDXLExporter.OmitRichtextAttachments isn't available, are you able to develop an agent in the relevant Domino database (or in another database created for this purpose) that acts as a go-between?

I'm thinking an agent could take the note id of the target document via NotesAgent.Run, and export that document's DXL to a field (which might have to be rich text if the DXL is more than 32kB) in another temporary document. Your code should call that agent via COM, get the resulting temporary document, read the DXL from its field, then delete the temporary document.
This seems overly complex, but it's the only solution that occurs to me.

Scott Leis
  • 2,810
  • 6
  • 28
  • 42
0

Try running your code as a LotusScript agent.

If it fails, the problem is inherent in the classes, not in the COM implementation and there's not going to be much you can do other than trying a more up-to-date version of Notes/Domino.

If it works, a potential workaround would be to have your COM code invoke a LotusScript agent on the server to do this part of the work.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41