OleFormatAutoUpdate Property

Specifies whether the link to the OLE object is automatically updated or not in Microsoft Word.

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool AutoUpdate { get; set; }

Property Value

Type: Boolean
Remarks

The default value is false.

Examples
Shows how to extract embedded OLE objects into files.
Document doc = new Document(MyDir + "OLE spreadsheet.docm");

// The first shape will contain an OLE object
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);

// This object is a Microsoft Excel spreadsheet
OleFormat oleFormat = shape.OleFormat;
Assert.AreEqual("Excel.Sheet.12", oleFormat.ProgId);

// Our object is neither auto updating nor locked from updates
Assert.False(oleFormat.AutoUpdate);
Assert.AreEqual(false, oleFormat.IsLocked);

// If we want to extract the OLE object by saving it into our local file system, this property can tell us the relevant file extension
Assert.AreEqual(".xlsx", oleFormat.SuggestedExtension);

// We can save it via a stream
using (FileStream fs = new FileStream(ArtifactsDir + "OLE spreadsheet extracted via stream" + oleFormat.SuggestedExtension, FileMode.Create))
{
    oleFormat.Save(fs);
}

// We can also save it directly to a file
oleFormat.Save(ArtifactsDir + "OLE spreadsheet saved directly" + oleFormat.SuggestedExtension);
See Also