[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Lotus Notes 6.5 Domino COM API and extracting Attachments

Asked by jhieb in Lotus Notes

Tags: lotus, notes


This is definitely an expert question. Please let me know if I need to post this to a different discussion group and which one that would be. Thanks.

Does anyone know of a rock-solid approach to extracting attachments from Notes using the COM API?  Maybe the answer is to NOT use the COM API? We have tried the following:

1)        

a)       The following approach intermittently has a null EmbeddedObject.  The biggest problem with this approach is that I have no way to match the externalFileNames (attachment name shown in viewer) with the internal names (pName required by NotesDocument.GetAttachment()).

·          Get the internal attachment names from the lotus script @AttachmentName

·          Iterate and call the NotesDocument.GetAttachment(internalAttachmentName) to get a Domino.NotesEmbeddedObject

·          Check the type of NotesEmbeddedObject to ensure it is a Domino.EMBED_TYPE.EMBED_ATTACHMENT

·          Then call EmbeddedObject.ExtractFile(externalFileName);

b)       This approach has not been stable.  The Navigator intermittently blows up; running the same test again may or may not work (can’t be attributed to a certain item)

·         Get the body: Domino.NotesItem bodyItem = _dominoNotesDocument.GetFirstItem("Body");

·         Check to ensure body is not null and is Domino.IT_TYPE.RICHTEXT

·         Create a NotesRichTextItem:  _dominoNotesDocument.CreateRichTextItem(TEMP_ITEM_NAME)

·         Append the body to the NotesRichTextItem: rti.AppendRTItem((Domino.NotesRichTextItem)bodyItem)

·         Save the Document: _dominoNotesDocument.Save(true, false, false);

·         Create a Navigator: Domino.NotesRichTextNavigator navigator = rti.CreateNavigator()

·         if(navigator.FindFirstElement(Domino.RT_ELEM.RTELEM_TYPE_FILEATTACHMENT))

·         do

·         {

·           Domino.NotesEmbeddedObject embeddedObj = navigator.GetElement()

·           embeddedObj.ExtractFile(externalFileName);

·         }

·         while(navigator.FindNextElement(Domino.RT_ELEM.RTELEM_TYPE_FILEATTACHMENT, 1));

c)       This approach blows up intermittently when attempting to iterate the NoteRichTextItem.EmbeddedObject array

·         Get the body: Domino.NotesItem bodyItem = _dominoNotesDocument.GetFirstItem("Body");

·         Check to ensure body is not null and is Domino.IT_TYPE.RICHTEXT

·         Create a NotesRichTextItem:  _dominoNotesDocument.CreateRichTextItem(TEMP_ITEM_NAME)

·         Append the body to the NotesRichTextItem: rti.AppendRTItem((Domino.NotesRichTextItem)bodyItem)

·         Save the Document: _dominoNotesDocument.Save(true, false, false);

·         object[] embeddedObjects = (object[])rti.EmbeddedObjects;

·         //check null for embeddedObjects

·         foreach(Domino.NotesEmbeddedObject embeddedObj in (System.Array)rti.EmbeddedObjects)

·         {

·         if (embeddedObj.type == Domino.EMBED_TYPE.EMBED_ATTACHMENT)

·         {

·           embeddedObj.ExtractFile(externalFileName);

·         }

2)       How can we best match up the Attachment internal names with the external names (that display in the viewer)?  I can get the internal names from the @AttachmentNames lotus script call.  Ex. _dominoNotesDocument.ParentDatabase.Parent.Evaluate("@AttachmentNames", _dominoNotesDocument);.  But I need to extract the attachment to disk with the external name.

a)       I have exported DXL for documents and looked for the “attachmentref” attribute. This is the only way I have found to get the mapping between internal and external attachment names.  Unfortuneately, this is extremely slow and doesn’t work for all documents (occaissionally throws exception on certain documents.

Thanks in advance for any feedback!

[+][-]11/27/03 04:41 PM, ID: 9834399Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Lotus Notes
Tags: lotus, notes
Sign Up Now!
Solution Provided By: qwaletee
Participating Experts: 3
Solution Grade: A
 
[+][-]11/26/03 11:03 AM, ID: 9826825Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 11:07 AM, ID: 9826851Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 11:38 AM, ID: 9827081Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/26/03 11:40 AM, ID: 9827100Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 01:04 PM, ID: 9827689Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/26/03 05:04 PM, ID: 9828907Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 05:07 PM, ID: 9828911Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 05:51 PM, ID: 9829073Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/26/03 06:06 PM, ID: 9829138Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/26/03 06:16 PM, ID: 9829165Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/27/03 07:07 AM, ID: 9832111Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/28/03 09:42 AM, ID: 9838915Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/03 05:42 PM, ID: 9854835Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/01/03 11:50 PM, ID: 9856421Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/02/03 04:12 AM, ID: 9857419Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93