When updating OLE Link with Aspose.Words the Size of OLE has changed

TestCase.zip (447.9 KB)
Hi All,
I have the licensed Aspose.Word and when updating the OLe link on the word document the size of the Chart which is linked with Excel is changed, while when I am using Microsoft.Interop.Word the size remains as the source but with Aspose it releases the source size.
attached is my Code sample with documents I used also two screenshots from using Microsoft and Aspose.
If anyone can help me, thanks in advance.

void tryAspose(string TemplateFile, string ExcelTemplateFile, string ReportFile)
{
    AspWords.Document RepDoc;
    File.Copy(TemplateFile, ReportFile, true);
    RepDoc = new AspWords.Document(TemplateFile);
    AspWords.NodeCollection AllShapes = RepDoc.GetChildNodes(AspWords.NodeType.Shape, true);

    if (AllShapes.Count > 0)
    {
        foreach (Shape shp in AllShapes)
        {
            if (shp.OleFormat != null)
            {
                //Replace links whose path contains the text "_Template"
                if (shp.OleFormat.SourceFullName.IndexOf("_Template", StringComparison.CurrentCultureIgnoreCase) == -1)
                {
                    continue;
                }
                shp.OleFormat.SourceFullName = ExcelTemplateFile;
            }
        }
    }
    RepDoc.Save(ReportFile);
}

@omar.sidiqy Unfortunately, I cannot reproduce the problem on my side using the latest version of Aspose.Words. After changing OleFormat.SourceFullName and saving the output document the output document looks the same as the input document.
Could you please attach your output document produced on your side for our reference?

Hi @alexey.noskov
after generating the document, when you open the document it asks you :
“The document contains links that may refer to other files, do you want to update this document with the data from the linked files?”
then if you click No, the document is the same as the input and there is no change in size, if you click Yes then the size is going to change, but if you use Microsoft interop if you click on Yes or No the size is not gonna change.
attached is the Aspose-generated, in input its 3 pages but output is 4 pages.Report_FileAspose.docx (62.9 KB)
word Document.

@omar.sidiqy Thank you for additional information. For a sake of correction the issue has been logged as WORDSNET-24541. We will keep you updated and let you know once the issue is resolved or we have more information for you.

Hi @alexey.noskov
Is there any update regarding this issue?
thanks

@omar.sidiqy Unfortunately, there are no news yet regarding the issue. It is currently in the queue for analysis. Once it is analyzed we will be able to provide you more information.

Hi,
Is there any updates regarding this? I’ve been facing the same issue and would love to find out more about this.

@JThomas98 Unfortunately, the issue is not resolved yet. Please accept our apologies for your inconvenience.

@alexey.noskov,
Thank you for the quick reply!
Is there a resizing factor that aspose uses that I could use to manually adjust the size of the image?

@JThomas98 There is no resizing factor. The problem is in logic MS Word calculates size of the OLE image, which is not fully implemented in Aspose.Words. So unfortunately, at the moment, I cannot suggest you a workaround

I see, thanks @alexey.noskov!

1 Like