Modules@robinpath/office

@robinpath/office

0.1.1Public

Microsoft Office document creation and reading (Word, Excel, PowerPoint) for RobinPath

@robinpath/office

Enterprise Microsoft Office suite — Word (.docx), Excel (.xlsx), PowerPoint (.pptx) with 57 functions: hyperlinks, TOC, footnotes, comments, sections, headers/footers, doc patching, conditional formatting, data validation, sheet protection, slide masters, and more

Category Functions Auth License

Why use this module?

The office module lets you:

  • Create a new Word document
  • Read text or HTML from an existing Word document
  • Add a heading with level and formatting
  • Add a paragraph with rich text formatting
  • Add a table with full styling (headers, borders, colors, widths)

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/office

Quick Start

No credentials needed — start using it right away:

office.readDoc "./contract.docx" "text" into $content

Available Functions

FunctionDescription
office.createDocCreate a new Word document
office.readDocRead text or HTML from an existing Word document
office.addHeadingAdd a heading with level and formatting
office.addParagraphAdd a paragraph with rich text formatting
office.addTableAdd a table with full styling (headers, borders, colors, widths)
office.addImageAdd an image to the document
office.addPageBreakAdd a page break
office.addListAdd a bulleted or numbered list
office.addHyperlinkAdd a clickable hyperlink to the document
office.addBookmarkAdd a named bookmark for cross-references
office.addTableOfContentsAdd an auto-generated table of contents from headings
office.addFootnoteAdd a footnote reference in text with footnote content at bottom
office.addCommentAdd a comment annotation on a text range
office.addSectionAdd a new document section with separate formatting (orientation, columns, margins)
office.setDocPropertiesSet document metadata properties (title, author, keywords)
office.addDocStyleDefine a reusable named paragraph or character style
office.addHeaderAdd a custom header to the current section
office.addFooterAdd a custom footer with optional page numbers
office.patchDocModify an existing .docx by replacing placeholders with new content
office.addCheckboxAdd a checkbox with label text
office.saveDocSave the Word document to a .docx file
office.createSheetCreate a new Excel workbook
office.readSheetRead data from an existing Excel file
office.addRowAdd a row with optional styling
office.writeDataWrite array of objects to sheet with auto-headers and styling
office.writeCellWrite a value to a specific cell with formatting
office.styleRangeApply formatting to a range of cells
office.addFormulaAdd a formula to a cell
office.setColumnWidthSet column widths
office.mergeCellsMerge a range of cells
office.loadSheetLoad an existing Excel file for editing
office.addWorksheetAdd a new worksheet to an existing workbook
office.freezePanesFreeze header rows and/or columns
office.setAutoFilterAdd filter dropdowns on header columns
office.addConditionalFormatAdd conditional formatting rules (color scales, data bars, icon sets, cell rules)
office.addDataValidationAdd data validation (dropdowns, number/date constraints) to a cell
office.addCellCommentAdd a comment/note to a cell
office.addSheetImageEmbed an image in a spreadsheet
office.addNamedRangeDefine a named range for formulas
office.protectSheetProtect a worksheet with a password and permission options
office.hideRowsColumnsHide or show rows and columns
office.saveSheetSave the workbook to an .xlsx file
office.createSlidesCreate a new PowerPoint presentation
office.addSlideAdd a slide with optional title/subtitle and background
office.addSlideTextAdd a text box to a slide with full formatting
office.addSlideImageAdd an image to a slide with positioning
office.addSlideTableAdd a data table to a slide with styling
office.addSlideChartAdd a chart to a slide
office.addSlideShapeAdd a shape to a slide
office.addSlideNotesAdd speaker notes to a slide
office.addSlideMultiTextAdd rich text with mixed formatting (bold/italic/color) in one text box
office.setSlideNumberAdd a slide number to a slide
office.defineSlideMasterDefine a reusable slide master template with logo, background, and placeholders
office.addSlideFromMasterCreate a new slide from a defined master template
office.saveSlidesSave the presentation to a .pptx file
office.setSheetPrintConfigure print layout: paper size, orientation, print area, margins
office.groupRowsGroup rows (or columns) into collapsible outline groups

Examples

Read text or HTML from an existing Word document

office.readDoc "./contract.docx" "text" into $content

Add a heading with level and formatting

office.addHeading $doc "Sales Report" 1 {"color": "#2196F3", "alignment": "center"}

Add a paragraph with rich text formatting

office.addParagraph $doc "Revenue increased by 23%" {"bold": true, "fontSize": 12, "alignment": "justify", "spacing": {"after": 200}}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/office";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  office.readDoc "./contract.docx" "text" into $content
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/office
Version0.1.1
LicenseMIT
Unpacked Size27.6 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

productivity