We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Could not save embedded objects with Aspose.Words for .NET properly

I downloaded evaluation version of Aspose.Words for .NET last Friday.

I was able to save .ZIP file from Microsoft word 2003 file. I tried another file which had .XLS file as embedded object but the saved file could not be opened in native Excel application.

Please let me know if this library will work for saving embedded objects in its native format. Another issue is OleFormat.Save method takes only filename as argument without path and it saves the file in the original file location. This method should have another overload to save the file in another path.

Please let me know how reliable this library is for saving embedded items.

Thanks

BPatel

Hi

Thank you for your interest in Aspose products.

1. Please, attach your document for testing. I will investigate this problem and provide you more information.

2. You can use the following code.

string fullFilePath = @”c:\temp\testfile.data”;

Shape.OleFormat.Save(fullFilePath);

Best regards.

I have attached the sample file here. Please note that this is a very basic test.

We will have various types that we will need to extract and it should be extracted to original file name. I was not able to get Source property also. Is there a way to get the file name?

We deal with various file types. So this logic should work reliably. We deal with 1000's of office files every day. We would also like to process other office files like XLS, PPT etc. I will download other types if this works reliably.

Thanks

Hi

Thanks for additional information. You can get PorgID of the OLE object. For example see the following code.

Document doc = new Document(@"310_100493_xbpatel\in.doc");

NodeCollection nodes = doc.GetChildNodes(NodeType.Shape, true);

int i = 0;

foreach (Shape shape in nodes)

{

if (shape.OleFormat != null)

{

string progID = shape.OleFormat.ProgId;

string extension = ".data";

switch (progID)

{

case "Excel.Sheet.8": //for Excel files

{

extension = ".xls";

break;

}

case "PowerPoint.Show.8": //for PowerPoint files

{

extension = ".ppt";

break;

}

}

shape.OleFormat.Save(@"310_100493_xbpatel\" + i.ToString() + extension);

i++;

}

}

Unfortunately, you can’t get original file name of embedded OLE object. This is Known issue (#3257).

Best regards.

Hi

Thanks for additional information. You can get PorgID of the OLE object. For example see the following code.

Document doc = new Document(@"310_100493_xbpatel\in.doc");

NodeCollection nodes = doc.GetChildNodes(NodeType.Shape, true);

int i = 0;

foreach (Shape shape in nodes)

{

if (shape.OleFormat != null)

{

string progID = shape.OleFormat.ProgId;

string extension = ".data";

switch (progID)

{

case "Excel.Sheet.8": //for Excel files

{

extension = ".xls";

break;

}

case "PowerPoint.Show.8": //for PowerPoint files

{

extension = ".ppt";

break;

}

}

shape.OleFormat.Save(@"310_100493_xbpatel\" + i.ToString() + extension);

i++;

}

}

Unfortunately, you can’t get original file name of embedded OLE object. This is Known issue (#3257).

Best regards.

The issues you have found earlier (filed as 3257) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(23)