Search code examples
outlook-redemption

How can we extract Outlook documents using Redemption.dll (version: 5.6.0.3644 )?


I am using the Redemption.dll (version: 5.6.0.3644). I want to use the ‘IRDODocumentItem’ to extract documents from Outlook folders. How can I achieve that?


Solution

  • No, I am not extracting attachment from the mail. I have a simple Folder in outlook that contains some word and excel documents. I did some research and extracted them like this

    if (objItem is RDODocumentItem)
                {
                    RDOAttachments rdoAttachments = null;
                    RDOAttachment rdoAttachment = null;
    
                    try
                    {
                        rdoAttachments = ((RDODocumentItem)objItem).Attachments;
                        if (rdoAttachments.Count > 0)
                        {
                            RDOAttachment attachment = ((RDODocumentItem)objItem).Attachments[1];
                            attachment.SaveAsFile(path);
                            NAR(attachment);
                            rdoAttachment = rdoAttachments[1];
                            rdoAttachment.SaveAsFile(path);
                        }
                    }
                    finally
                    {
                        NAR(rdoAttachment);
                        NAR(rdoAttachments);
                    }
                }
    

    Is it the correct way to extract document ?