Link to home
Start Free TrialLog in
Avatar of Alford Miller
Alford MillerFlag for United States of America

asked on

How do I Extract the Body of a Document in It's Original Form.

Hello all,
  How do I Extract the Body of a Document in It's Original Form.
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Programmatically, or Copy/Paste? What database/document: mail/memo, or a discussion db?
Avatar of qwaletee
qwaletee

Hi Alford-Miller,

Extract to where?


If you are talking about export, nothing will be "exactly in its original form."

If you are talking about moving it from one Notes doc to another, then it is possible.  You can simply do cut and paste, or you can use notesItem.copyToDocument


Cheers!
You mean you want to take snapshot of whole document and put it in another document ??

renderToRTItem method of NotesDocument will take the whole document and embeds it into the richtext of the document.

~Hemanth
Avatar of Alford Miller

ASKER

Sorry I should have clarified this a little better.  I want to export the Body of a NotesMail Document to a Rich Text Document File.  Currently I am sending the data to a file using the Print# command in LotusScript to send the either the "Text" property or "GetFormattedText" function depending on whether the Document is RichText or not.  This works but loose a lot of formating data plus it Handles HTML with links Terribly.  I am running notes on a 2000/XP network using Lotus R5.
Use File .. Export menu/command from the document . Select MS RTF Format and you will see the format is much better now.

Thank you, that works Perfect.  I there any way to do this programatically from LotusScript?
Equivalent would be @Command( [FileExport] ; fileType ; fileName ) , but LS doesn't support !
All my code is in LotusScript, Is there anyway to call the Formula Language from within LotusScript?  I was thinking of making a "Export" agent but how would I control which document is being saved if the LotusScript Code Select the Document?
There are 3rd party tools that support this in LS, like Midas, but they aren't for free.
What you could do is create an agent that does the @Command-stuff, and activate that agent from LS
If I activate the Agent from LotusScript, how do I control which document is the "Selected Document"?
Good question... Don't have the answer.

Maybe a bypass solution:
- set a certain field in the document to a specific value
- make a view/folder on documents that have that value
- the Formula-agent, when activated, should loop over all documents in that view/folder

if this is at all possible. Hemantha?
ASKER CERTIFIED SOLUTION
Avatar of HemanthaKumar
HemanthaKumar

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
Sjef, that would be more complicated and one more thing LS cannot access Formula agents ?!?
I'd certainly prefer the API stuff, I'll check it later...
Do it the R3 way... well, we can make it a LITTLE nicer.

Create a folder to contain all docs to be exported.
Create an agent that opens that folder, opens the current document, exports it, and removes the document frm the export folder.
Create an agent that:
1) Checks to see if there are any docs in the export folder
2) Aborts if none
3) Opens the folder
4) Opens whatever doc is highlighted
5) Exports it
6) Removes it from the folder
7) Closes the doc
8) Calls itself recursively

After step 8, when it gets called again, the first step prevents it from continuing to run once the last doc is processed.

Personally, I would rather use HTML export to do this, because Domino's HTML representation is much better than its MS RTF representation.
Thanks Folks, sorry I didn't get back to you all earlier.  I am going to try that API code on monday and see how it goes!  Thanks again for everything and I will look into the HTML export because your right, the RTF output leave a bit to be desired:-)