Link to home
Start Free TrialLog in
Avatar of tzYoni
tzYoni

asked on

Export Notes record as RTF file using C API

Hi

I need to export notes records as Microsoft RTF files.
Just like using File>Export and choosing Microsoft RTF.
I need to do it with via .NET application (using c API or Notes COM). Can't run any LS or add anything to the database.
There's a function called ExportRTF on nxrtf.dll that should do the job, but I can't get it running from .NET application.

Any help would be appreciated.

thanks
Yoni
Avatar of SysExpert
SysExpert
Flag of Israel image

please post your code, and maybe we can fix it.

I hope this helps !

see

https://www.experts-exchange.com/questions/21499863/Open-new-email-message-in-Lotus-Notes-from-within-a-NET-Windows-application.html

and specifcally

 Comment from ovalsquare
Date: 07/21/2005 10:30PM EST
      Author Comment       

SysExpert: well...appreciate the somewhat better direction, but I'm looking for C#.NET or VB.NET, not the C API. I'm going to dig into it further, but thus far, I have trouble believing there are no better samples out there for doing what must be a fairly common scenario.

sjef_bosman: Just what I'm looking for other than Single developer - US $795. Ouch! You've got to be kidding me! I just want access to the address book which there should be no need to go so high-powered.

Here's what I've got that functions to send off an email (although doesn't open it up for further editing, requires email address, etc.):

        Dim Maildb As Object
        Dim MailDoc As Object
        Dim Body As Object
        Dim Session As Object
        'Start a session to notes
        Session = CreateObject("Notes.NotesSession")
        'Open the mail database in notes
        Maildb = Session.GETDATABASE("", "C:\Program Files\lotus\notes\data\mail\ted.nsf")
        If Not Maildb.IsOpen = True Then
            Maildb.Open()
        End If
        'Create the mail document
        MailDoc = Maildb.CREATEDOCUMENT
        MailDoc.Form = "Memo"
        'Set the recipient
        MailDoc.sendto = "ted@somewhere.com"
        'Set subject
        MailDoc.Subject = "Subject text"
        'Create and set the Body content
        Body = MailDoc.CREATERICHTEXTITEM("Body")
        Call Body.APPENDTEXT("Body text here")
        'Example to create an attachment (optional)
        Call Body.ADDNEWLINE(2)
        'Call Body.EMBEDOBJECT(1454, "", "C:\filename", "Attachment")
        'Example to save the message (optional)
        MailDoc.SAVEMESSAGEONSEND = True
        'Send the document
        MailDoc.PostedDate = Now() 'Gets the mail to appear in the Sent items folder
        Call MailDoc.SEND(False)
        'Clean Up
        Maildb = Nothing
        MailDoc = Nothing
        Body = Nothing
        Session = Nothing

Of course, it's not all really updated to .NET, but it works. Because it does, again, I have trouble believing there's not a simple solution already existing out there that will open up a new email with the Body and Subject already specified, but with To: field empty etc. I've done it with Outlook, Outlook Express, written an internal email application, but hooking it up with Lotus is rather interesting.

Thanks for any and all help!

Ted


ASKER CERTIFIED SOLUTION
Avatar of marilyng
marilyng

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial