Hallo!
I need some help for a LotusScript-Application that use c-api statement.
The script locate a document with NSFNotesOpenByUNID, attach a file with NSFNoteAttachFile and should place the file in a rich-text-item. For the last function i have to create a CDHOTSPOTBEGIN and a CDHOTSPOTEND to append it with NSFItemAppend.
I have the problem, to create this two objects - i do not know, how i have to set the values of the structs and with information i have to set at the values.
The application is currently only for LotusScript (Lotus Notes 6.5) and run in Win32 runtimes.
Please help me with a solution.
NR Michael Tassati
[michael.tassati@nimbus.at]
[www.nimbus.at]
[www.sbg.at/amt]
Subject: C-API: Attach file and append to rtitem
If you look in the C API, there are samples that show how to create rich text. Basically, you just need to iterate through the existing rich text, writing out the records to new blocks, then write out the new CD records you want at the end. After creating the new blocks, delete the old ones and append the new ones.
Of course, if it gets too difficult, you could always use our Midas Rich Text LSX and do it from LotusScript with:
Call rtitem.ConnectBackend(doc.Handle, “Body”, True)
Call rtitem.Everything.AppendFileAttachment(filename)
rtitem.Save
and it would attach the file and create the hotspot for you. You could even specify what image you want to show if you wanted something custom, but Midas is a third party product and does cost something (other than the development time which the C API version will cost you).
Subject: RE: C-API: Attach file and append to rtitem
Hallo Ben!
Thank you for reply!
It is not able to use a LSX in my connection.
At the Toolkit databases are only basics for creating hotspots, and i do not
have a problem to create a link hotspot. For the file attachment i have to
create particularly kind of hotspot.
Do you have a example script to create this?
NR Michael Tassati
a href=‘mailto:michael.tassati@nimbus.at’>michael.tassati@nimbus.at]
a href=‘http://www.nimbus.at’>www.nimbus.at]
a href=‘http://www.sbg.at/amt’>www.sbg.at/amt]
Subject: RE: C-API: Attach file and append to rtitem
Out of curiosity, are you unable to use an LSX, or unable to use a third party product. Midas is available as a C++ extension as well.
In any case, the trick is to do what you want manually (attach a file where you want it), then use NotesPeek to see what changed. Do this before and after a couple of times and you will quickly see what you need to do. No, I don’t have a sample script, as messing with CD records has a lot of gotchas which I couldn’t possibly document (because we sell products in that area). Still, NotesPeek should help you for this.