Getting exception when extracting documents from Lotus Notes when using MS Office Document Template

5 pts.
Tags:
Lotus Notes 6.5

We are having a lotus notes application, where we are using MS Office DocumentTemplate to store MS Office documents.

We are using some C# application to extract all the office documents which are stored using MS Office Document template  from lotus notes db and we are not able to extract the documents. We have tried all possible combination and we are not able to extract. We are using the following code snippet to extract document

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Domino;

namespace office
{
    class Program
    {
        static void Main(string[] args)
        {
          
            NotesDocument doc;
            //Creating the notes session and passing password
            NotesSession session = new NotesSession();           
            session.Initialize("infy@123");
            NotesDatabase NotesDb = session.GetDatabase("", @"C:Usersvivek_ealumalaiDesktopMSLibrary.nsf", false);
           
            Domino.NotesDocumentCollection col = NotesDb.AllDocuments;
            for (int i = 0; i < col.Count; ++i)
            {
                doc = col.GetNthDocument(i);
                if (doc.HasEmbedded && doc.HasItem("$File"))
                {
                    object[] items = (object[])doc.Items;
                    foreach (NotesItem item in items)
                    {
                        if (item.Name.Equals("$FILE"))
                        {
                            object[] values = (object[])item.Values;
                            doc.GetAttachment(values[0].ToString()).ExtractFile(@"D:Temp" + values[0].ToString());
                        }
                    }
                }
            }
        }
    }
}

But if we use "New Document"  template, we are able to extract the documents



Software/Hardware used:
Lotus Notes 6.5

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following