microsoft-word

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Microsoft Word Skill

Microsoft Word 技能

Overview

概述

Claude can work with Microsoft Word Online to create, edit, and format documents. This includes writing content, applying styles, inserting media, collaborating with comments, and exporting documents.
Claude可以借助Microsoft Word Online创建、编辑和格式化文档。这包括撰写内容、应用样式、插入媒体、通过批注协作以及导出文档。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/microsoft-word/install.sh | bash
Or manually:
bash
cp -r skills/microsoft-word ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/microsoft-word/install.sh | bash
或者手动安装:
bash
cp -r skills/microsoft-word ~/.canifi/skills/

Setup

配置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

首先,确保已安装canifi-env:

canifi-env set MICROSOFT_EMAIL "your-email@outlook.com"
undefined
canifi-env set MICROSOFT_EMAIL "your-email@outlook.com"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
您的凭据,由您做主。Canifi LifeOS 尊重您的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果您不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化设置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. Claude将使用您的已认证会话,且绝不会看到您的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果您愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭据仅能在您的本地机器上访问,绝不会被传输。

Capabilities

功能

  • Create new documents from scratch or templates
  • Read and edit existing documents
  • Apply formatting and styles
  • Insert images, tables, and charts
  • Add headers, footers, and page numbers
  • Track changes and add comments
  • Create table of contents
  • Export as PDF, DOCX, or other formats
  • Collaborate in real-time
  • Use dictation and voice typing
  • Apply templates and themes
  • 从头开始或基于模板创建新文档
  • 读取和编辑现有文档
  • 应用格式和样式
  • 插入图片、表格和图表
  • 添加页眉、页脚和页码
  • 跟踪更改并添加批注
  • 生成目录
  • 导出为PDF、DOCX或其他格式
  • 实时协作
  • 使用语音听写和语音输入
  • 应用模板和主题

Usage Examples

使用示例

Example 1: Create Document

示例1:创建文档

User: "Create a Word document for my project report"
Claude: Creates new document "Project Report", adds title,
        sections for Introduction, Methodology, Results, Conclusion.
        Returns: "Created document: [link]"
用户:"为我的项目报告创建一个Word文档"
Claude:创建名为“项目报告”的新文档,添加标题,以及引言、方法论、结果、结论等章节。返回:"已创建文档:[链接]"

Example 2: Format Document

示例2:格式化文档

User: "Apply professional formatting to my resume"
Claude: Opens resume, applies consistent heading styles,
        adjusts margins, adds section dividers.
        Confirms: "Professional formatting applied"
用户:"为我的简历应用专业格式"
Claude:打开简历,应用一致的标题样式,调整边距,添加章节分隔符。确认:"已应用专业格式"

Example 3: Add Table

示例3:添加表格

User: "Insert a comparison table in my document"
Claude: Inserts table with appropriate columns and rows,
        formats with alternating colors.
        Confirms: "Comparison table inserted"
用户:"在我的文档中插入一个对比表格"
Claude:插入带有合适列和行的表格,设置交替颜色格式。确认:"已插入对比表格"

Example 4: Export PDF

示例4:导出PDF

User: "Export my proposal as a PDF"
Claude: Opens document, navigates to File > Export > PDF,
        downloads file. Reports: "Proposal exported as PDF"
用户:"将我的提案导出为PDF"
Claude:打开文档,导航至“文件”>“导出”>“PDF”,下载文件。报告:"提案已导出为PDF"

Authentication Flow

认证流程

  1. Claude navigates to word.office.com via Playwright MCP
  2. Authenticates with MICROSOFT_EMAIL if needed
  3. Handles 2FA if prompted (notifies user via iMessage)
  4. Maintains session for document operations
  1. Claude通过Playwright MCP导航至word.office.com
  2. 如有需要,使用MICROSOFT_EMAIL进行认证
  3. 若提示两步验证,将通过iMessage通知用户
  4. 维持会话以进行文档操作

Selectors Reference

选择器参考

javascript
// New document
'[aria-label="New blank document"]'

// Document title
'[aria-label="Document name"]'

// Editing area
'[contenteditable="true"]' or '.WACEditing'

// Ribbon tabs
'[role="tablist"]'

// Home tab
'[aria-label="Home"]'

// Insert tab
'[aria-label="Insert"]'

// Bold button
'[aria-label="Bold"]'

// Font selector
'[aria-label="Font"]'

// Style gallery
'[aria-label="Styles"]'

// Save button
'[aria-label="Save"]'

// Share button
'[aria-label="Share"]'
javascript
// New document
'[aria-label="New blank document"]'

// Document title
'[aria-label="Document name"]'

// Editing area
'[contenteditable="true"]' or '.WACEditing'

// Ribbon tabs
'[role="tablist"]'

// Home tab
'[aria-label="Home"]'

// Insert tab
'[aria-label="Insert"]'

// Bold button
'[aria-label="Bold"]'

// Font selector
'[aria-label="Font"]'

// Style gallery
'[aria-label="Styles"]'

// Save button
'[aria-label="Save"]'

// Share button
'[aria-label="Share"]'

Error Handling

错误处理

  • Login Failed: Retry 3 times, notify user via iMessage
  • Session Expired: Re-authenticate automatically
  • Document Not Found: Search OneDrive, ask for clarification
  • Save Failed: Enable AutoSave, retry, copy as backup
  • Format Apply Failed: Retry, try alternative method
  • Export Failed: Try alternative format, notify user
  • 登录失败:重试3次,通过iMessage通知用户
  • 会话过期:自动重新认证
  • 文档未找到:搜索OneDrive,请求用户澄清
  • 保存失败:启用自动保存,重试,创建副本作为备份
  • 格式应用失败:重试,尝试替代方法
  • 导出失败:尝试其他格式,通知用户

Self-Improvement Instructions

自我改进说明

When you learn a better way to accomplish a task with Word Online:
  1. Document the improvement in your response
  2. Suggest updating this skill file with the new approach
  3. Include specific keyboard shortcuts or ribbon paths
  4. Note differences from desktop Word
当您掌握了使用Word Online完成任务的更好方法时:
  1. 在回复中记录改进内容
  2. 建议使用新方法更新此技能文件
  3. 包含具体的键盘快捷键或功能区路径
  4. 注明与桌面版Word的差异

Notes

注意事项

  • Word Online auto-saves to OneDrive
  • Some features only available in desktop version
  • Real-time collaboration shows other users' cursors
  • Templates available from Start screen
  • Track changes for revision management
  • Comments for collaboration feedback
  • Editor pane for writing suggestions
  • Dictation available with microphone
  • Word Online会自动保存至OneDrive
  • 部分功能仅在桌面版中可用
  • 实时协作会显示其他用户的光标
  • 起始屏幕提供模板
  • 使用跟踪更改进行版本管理
  • 使用批注进行协作反馈
  • 编辑器窗格提供写作建议
  • 连接麦克风后可使用语音听写