iOfficeAI / iOfficeAI/OfficeCLI

v1.0.144: native render reports Office missing when COM document open fails

Open
#326 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
30.7k
Forks
2.1k
Avg merge
9d 8h
Merged PRs (30d)
5

Description

## Summary

On Windows with Office 2016 PowerPoint installed and PowerPoint COM activation working, OfficeCLI v1.0.144 reports:

```
--render native requires Windows with Microsoft PowerPoint installed
```

for a real PPTX whose direct PowerPoint COM open fails with HRESULT `0x80070570` (file or directory is corrupted and unreadable). The generic message makes a document-compatibility/open failure look like an application-installation failure.

## Environment

- OfficeCLI: `1.0.144`
- Binary SHA-256: `E780CC6A5385F84B4D54D71B0C179904ED534125EC33FE39B1A8711FA80E387E`
- Windows
- Office 16 PowerPoint is installed
- `PowerPoint.Application` COM activation succeeds

## Reproduction

1. Prepare a PPTX generated by the same `pptxgenjs` dependency used by the application.
2. Verify that `officecli validate` and LibreOffice rendering pass.
3. Run the native screenshot path on an isolated copy:

```text
officecli screenshot .pptx --render native --allow-native
```

4. OfficeCLI returns the generic "requires Windows with Microsoft PowerPoint installed" error.
5. Open the same isolated copy directly through PowerPoint COM in read-only mode:

```text
PowerPoint.Application.Visible = False
PowerPoint.Presentations.Open(path, WithWindow=False, ReadOnly=True)
```

The open call returns `0x80070570`.

Control samples created with the same `pptxgenjs` dependency, including a minimal deck, a deck with speaker notes, and a deck with a custom slide master, all open through PowerPoint COM. This indicates that the failure is document/object-specific, not a general `pptxgenjs`, notes, or master incompatibility.

No private PPTX or local path is attached.

## Suspected cause

The v1.0.144 native PPTX/DOCX branches catch the native invocation failure and replace the original exception with a generic "install PowerPoint/Word" message:

- PPTX: https://github.com/iOfficeAI/OfficeCLI/blob/v1.0.144/src/officecli/CommandBuilder.View.cs#L263-L283
- DOCX: https://github.com/iOfficeAI/OfficeCLI/blob/v1.0.144/src/officecli/CommandBuilder.View.cs#L354-L389

## Expected behavior

Please preserve the original failure stage and exception/HRESULT:

- COM activation/class-not-registered failure should be reported as application unavailable.
- COM activation succeeds but document open fails should be reported as a document-open/native-render failure, including the original HRESULT and exception text.
- Capability detection should not infer "Office is not installed" from a document-open exception.

A structured diagnostic result would be useful, for example `APP_UNAVAILABLE` versus `FAIL_OPEN`/native document-open failure, while retaining stderr and exit code.

Contributor guide

Open the contributing guide

Research direction

Start in src/officecli/CommandBuilder.View.cs at the PPTX lines 263-283 and DOCX lines 354-389, then reproduce the native screenshot command with an isolated PPTX. Trace whether COM activation or document opening fails, and verify that the completed behavior preserves the original HRESULT and exception while distinguishing application-unavailable from document-open failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.