public class OleObjectFrame extends GraphicalObject implements IOleObjectFrame
Represents an OLE object on a slide.
The following example shows how to accessing OLE Object frames.// Loads the PPTX to a presentation object Presentation pres = new Presentation("AccessingOLEObjectFrame.pptx"); try { // Accesses the first slide ISlide sld = pres.getSlides().get_Item(0); // Casts the shape to OleObjectFrame OleObjectFrame oleObjectFrame = (OleObjectFrame) sld.getShapes().get_Item(0); // Reads the OLE Object and writes it to disk if (oleObjectFrame != null) { // Gets embedded file data byte[] data = oleObjectFrame.getEmbeddedData().getEmbeddedFileData(); // Gets embedded file extention String fileExtension = oleObjectFrame.getEmbeddedData().getEmbeddedFileExtension(); // Creates a path to save the extracted file String extractedPath = "excelFromOLE_out" + fileExtension; // Saves extracted data Files.write(Paths.get(extractedPath), data); } } catch(IOException e) { } finally { if (pres != null) pres.dispose(); }
| Modifier and Type | Method and Description |
|---|---|
IOleEmbeddedDataInfo |
getEmbeddedData()
Gets or sets information about OLE embedded data.
|
java.lang.String |
getEmbeddedFileLabel()
Returns the file name of embedded OLE object
|
java.lang.String |
getEmbeddedFileName()
Returns the path of embedded OLE object
|
java.lang.String |
getLinkFileName()
Returns the full path to a linked file.
|
java.lang.String |
getLinkPathLong()
Returns the full path to a linked file.
|
java.lang.String |
getLinkPathRelative()
Returns the relative path to a linked file if present, otherwise returns an empty string.
|
java.lang.String |
getObjectName()
Returns or sets the name of an object.
|
java.lang.String |
getObjectProgId()
Returns the ProgID of an object.
|
IPictureFillFormat |
getSubstitutePictureFormat()
Returns OleObject image fill properties object.
|
java.lang.String |
getSubstitutePictureTitle()
Returns or sets the title for OleObject icon.
|
boolean |
getUpdateAutomatic()
Determines if the linked embedded object is automatically updated when the presentation is opened or printed.
|
boolean |
isObjectIcon()
Determines whether an object is visible as icon.
|
boolean |
isObjectLink()
Determines whether an object is linked to external file.
|
void |
setEmbeddedData(IOleEmbeddedDataInfo embeddedData)
Sets information about OLE embedded data.
|
void |
setLinkPathLong(java.lang.String value)
Returns the full path to a linked file.
|
void |
setObjectIcon(boolean value)
Determines whether an object is visible as icon.
|
void |
setObjectName(java.lang.String value)
Returns or sets the name of an object.
|
void |
setObjectProgId(java.lang.String value)
Returns the ProgID of an object.
|
void |
setSubstitutePictureTitle(java.lang.String value)
Returns or sets the title for OleObject icon.
|
void |
setUpdateAutomatic(boolean value)
Determines if the linked embedded object is automatically updated when the presentation is opened or printed.
|
getGraphicalObjectLockaddPlaceholder, getAlternativeText, getAlternativeTextTitle, getBasePlaceholder, getBlackWhiteMode, getConnectionSiteCount, getCustomData, getEffectFormat, getFillFormat, getFrame, getHeight, getHidden, getHyperlinkClick, getHyperlinkManager, getHyperlinkMouseOver, getImage, getImage, getLineFormat, getName, getOfficeInteropShapeId, getParent_Immediate, getParentGroup, getPlaceholder, getPresentation, getRawFrame, getRotation, getShapeLock, getSlide, getThreeDFormat, getThumbnail, getThumbnail, getUniqueId, getWidth, getX, getY, getZOrderPosition, isDecorative, isGrouped, isTextHolder, removePlaceholder, setAlternativeText, setAlternativeTextTitle, setBlackWhiteMode, setDecorative, setFrame, setHeight, setHidden, setHyperlinkClick, setHyperlinkMouseOver, setName, setRawFrame, setRotation, setWidth, setX, setY, writeAsSvg, writeAsSvgequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGraphicalObjectLockaddPlaceholder, getAlternativeText, getAlternativeTextTitle, getBasePlaceholder, getBlackWhiteMode, getConnectionSiteCount, getCustomData, getEffectFormat, getFillFormat, getFrame, getHeight, getHidden, getImage, getImage, getLineFormat, getName, getOfficeInteropShapeId, getParentGroup, getPlaceholder, getRawFrame, getRotation, getShapeLock, getThreeDFormat, getThumbnail, getThumbnail, getUniqueId, getWidth, getX, getY, getZOrderPosition, isDecorative, isGrouped, isTextHolder, removePlaceholder, setAlternativeText, setAlternativeTextTitle, setBlackWhiteMode, setDecorative, setFrame, setHeight, setHidden, setName, setRawFrame, setRotation, setWidth, setX, setY, writeAsSvg, writeAsSvggetSlidegetPresentationgetHyperlinkClick, getHyperlinkManager, getHyperlinkMouseOver, setHyperlinkClick, setHyperlinkMouseOverpublic final IPictureFillFormat getSubstitutePictureFormat()
Returns OleObject image fill properties object.
Read-only IPictureFillFormat.
getSubstitutePictureFormat in interface IOleObjectFramepublic final java.lang.String getSubstitutePictureTitle()
Returns or sets the title for OleObject icon.
Read/write String.
getSubstitutePictureTitle in interface IOleObjectFramepublic final void setSubstitutePictureTitle(java.lang.String value)
Returns or sets the title for OleObject icon.
Read/write String.
setSubstitutePictureTitle in interface IOleObjectFramepublic final java.lang.String getObjectName()
Returns or sets the name of an object.
Read/write String.
getObjectName in interface IOleObjectFramepublic final void setObjectName(java.lang.String value)
Returns or sets the name of an object.
Read/write String.
setObjectName in interface IOleObjectFramepublic final java.lang.String getObjectProgId()
Returns the ProgID of an object.
Read only String.
getObjectProgId in interface IOleObjectFramepublic final void setObjectProgId(java.lang.String value)
Returns the ProgID of an object.
Read only String.
setObjectProgId in interface IOleObjectFramepublic final java.lang.String getLinkFileName()
Returns the full path to a linked file. Short file name will be used.
Read-only String.
getLinkFileName in interface IOleObjectFramepublic final java.lang.String getLinkPathLong()
Returns the full path to a linked file. Long file name will be used.
Read/write String.
getLinkPathLong in interface IOleObjectFramepublic final void setLinkPathLong(java.lang.String value)
Returns the full path to a linked file. Long file name will be used.
Read/write String.
setLinkPathLong in interface IOleObjectFramepublic final java.lang.String getLinkPathRelative()
Returns the relative path to a linked file if present, otherwise returns an empty string.
Readonly String.
Presentation presentation = new Presentation("demo.ppt"); try { IOleObjectFrame oleFrame = (IOleObjectFrame)presentation.getSlides().get_Item(0).getShapes().get_Item(0); if (oleFrame != null) { System.out.println("The relative path: " + oleFrame.getLinkPathRelative()); } } finally { if (presentation != null) presentation.dispose(); }
getLinkPathRelative in interface IOleObjectFramepublic final java.lang.String getEmbeddedFileLabel()
Returns the file name of embedded OLE object
getEmbeddedFileLabel in interface IOleObjectFramepublic final java.lang.String getEmbeddedFileName()
Returns the path of embedded OLE object
getEmbeddedFileName in interface IOleObjectFramepublic final IOleEmbeddedDataInfo getEmbeddedData()
Gets or sets information about OLE embedded data.
Read/write IOleEmbeddedDataInfo.
getEmbeddedData in interface IOleObjectFramepublic final void setEmbeddedData(IOleEmbeddedDataInfo embeddedData)
Sets information about OLE embedded data.
Presentation pres = new Presentation("SomePresentation.pptx"); try { OleObjectFrame oof = (OleObjectFrame) pres.getSlides().get_Item(0).getShapes().get_Item(0); if (oof != null) { IOleEmbeddedDataInfo newData = new OleEmbeddedDataInfo(Files.readAllBytes(Paths.get("Picture.png")), "png"); oof.setEmbeddedData(newData); } } catch (IOException e) { } finally { if (pres != null) pres.dispose(); }
setEmbeddedData in interface IOleObjectFrameembeddedData - Embedded data IOleEmbeddedDataInfo
com.aspose.ms.System.ArgumentNullException - When embeddedData parameter is null.public final boolean isObjectIcon()
Determines whether an object is visible as icon.
Read/write boolean.
isObjectIcon in interface IOleObjectFramepublic final void setObjectIcon(boolean value)
Determines whether an object is visible as icon.
Read/write boolean.
setObjectIcon in interface IOleObjectFramepublic final boolean isObjectLink()
Determines whether an object is linked to external file.
Read-only boolean.
isObjectLink in interface IOleObjectFramepublic final boolean getUpdateAutomatic()
Determines if the linked embedded object is automatically updated when the presentation is opened or printed.
Read/write boolean.
getUpdateAutomatic in interface IOleObjectFramepublic final void setUpdateAutomatic(boolean value)
Determines if the linked embedded object is automatically updated when the presentation is opened or printed.
Read/write boolean.
setUpdateAutomatic in interface IOleObjectFrameCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.