Free Support Forum -

Document Collection

Do we have any alternative for Microsoft Application.Documents in Aspose.


You can mimic this by using the following code:

// A Collection to hold opened documents
ArrayList arrDocuments = new ArrayList();

// open document 1
Document doc1 = new Document(dataDir + fileName);
// open document 2
Document doc2 = new Document(dataDir + fileName);
// open document 3
Document doc3 = new Document(dataDir + fileName);
// open document 4
Document doc4 = new Document(dataDir + fileName);
// open document 5
Document doc5 = new Document(dataDir + fileName);

foreach(Document document in arrDocuments)
    // your code

Also, please refer to the Aspose.Words for .NET API.

Following are the links to some useful resources you may need to accomplish your tasks.

Hi @awais.hafeez
Thanks for the reply. I am Using Microsoft Interop to close the word documents which are running on the PC.

WordDocumentCollection = WordApplication.Documents
WordDocumentCollection .Item(DocumentIndex).Close();

Is their any alternative to convert this in Aspose.


I am afraid, the requested feature is out of the scope of Aspose.Words for .NET API. If document is opened in Word application, Aspose.Words for .NET can not close it or interact with it. If we can help you with anything else, please feel free to ask.