-
Notifications
You must be signed in to change notification settings - Fork 465
word ole
zmworm edited this page Apr 29, 2026
·
17 revisions
Embedded OLE objects (Visio diagrams, Excel charts, equations, Word documents, etc.) stored in the document. Full Add/Get/Set/Query/Remove lifecycle supported.
Path: (inline within paragraphs, detected via w:object elements)
- add - Embed an OLE object
- set - Modify display properties (progId, name, display, width, height)
- get - Read OLE object properties and optionally extract the embedded binary
- query - Find OLE objects by selector
| Property | Accepted Values | Description |
|---|---|---|
name |
text | Display name |
display |
content, icon
|
Content preview or icon |
width |
unit-qualified | Display width (e.g., 6cm, 2in, 160pt) |
height |
unit-qualified | Display height |
Canonical Format schema (cross-format consistent):
| Attribute | Type | Description |
|---|---|---|
progId |
string | OLE ProgID (e.g., Visio.Drawing.15, Excel.Sheet.12, Word.Document.12, Package, Equation.3) |
contentType |
string | MIME type of the embedded content |
fileSize |
number | Size of embedded binary (bytes) |
width |
string | Display width (cm) |
height |
string | Display height (cm) |
display |
string |
content or icon
|
name |
string | Display name (from v:shape@alt or custom) |
relId |
string | Relationship ID of embedded part |
previewImage |
string | Path to extracted preview image (auto-converted EMF/WMF → PNG) |
previewContentType |
string | Preview image MIME type |
# Extract the embedded file to disk
officecli get report.docx '/body/p[3]/ole[1]' --save extracted.xlsxReturns savedTo (path) and savedBytes (size) in addition to the standard attributes.
# Find all OLE objects (picture selector also includes OLE)
officecli query report.docx "ole"
officecli query report.docx "object"
officecli query report.docx "embed"
# Attribute filters
officecli query report.docx 'ole[progId=Excel.Sheet.12]'
officecli query report.docx 'ole[fileSize>1000]'
officecli query report.docx 'ole[progId~=Word]'OLE object count appears in view outline:
File: report.docx | 12 paragraphs | 3 tables | 2 images | 1 OLE object
- OLE preview images in
.emfor.wmfformat are auto-converted to PNG for AI inspection and browser rendering. - HTML preview renders web-compatible preview images directly; metafile placeholders are shown with sized boxes.
- ProgID auto-detected from source file extension when omitted in Add.
- ProgID validation: ≤39 chars, no leading digit, valid COM characters.
- Empty or locked source files emit friendly stderr warnings.
- Resident mode supports add/set/remove/swap/get --save for OLE.
- Picture - Regular image elements
- Add Word - Add syntax with examples
- Word Reference - All Word elements
Based on OfficeCLI v1.0.64