Stats
Actions
Tags
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-wps-excel:ppt-core-apiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Application / app:WPS 应用对象
var pres = Application.ActivePresentation;
var slideCount = pres.Slides.Count;
var slide = pres.Slides.Item(1); // 1-based 索引
var pageW = pres.PageSetup.SlideWidth; // 默认 960
var pageH = pres.PageSetup.SlideHeight; // 默认 540
// 在末尾添加空白页
pres.Slides.Add(pres.Slides.Count + 1, 12);
// 参数2: Layout 枚举
// 1 = ppLayoutTitle (标题页)
// 2 = ppLayoutText (标题+正文)
// 6 = ppLayoutTitleOnly (仅标题)
// 7 = ppLayoutBlank (空白)
// 12 = ppLayoutCustom (自定义/空白)
var newSlide = pres.Slides.Item(pres.Slides.Count);
// 添加文本框 (left, top, width, height)
var shape = slide.Shapes.AddTextbox(1, 50, 30, 860, 80);
shape.TextFrame.TextRange.Text = "标题文本";
shape.TextFrame.TextRange.Font.Size = 28;
shape.TextFrame.TextRange.Font.Bold = true;
shape.TextFrame.TextRange.Font.Color.RGB = 0x000000; // RGB 格式(非 BGR)
shape.TextFrame.TextRange.Font.Name = "微软雅黑";
// 段落对齐
shape.TextFrame.TextRange.ParagraphFormat.Alignment = 2; // 1=左, 2=居中, 3=右
// 自动换行和内边距
shape.TextFrame.WordWrap = true;
shape.TextFrame.MarginLeft = 10;
shape.TextFrame.MarginTop = 5;
// 矩形 (left, top, width, height)
var rect = slide.Shapes.AddShape(1, 100, 200, 300, 150);
// 常用 AutoShapeType: 1=矩形, 5=圆角矩形, 9=圆形, 13=右箭头
rect.Fill.ForeColor.RGB = 0x4472C4; // 填充色
rect.Fill.Transparency = 0; // 0=不透明, 1=全透明
rect.Line.ForeColor.RGB = 0x2F528F; // 边框色
rect.Line.Weight = 1.5; // 边框宽度
rect.Line.Visible = true;
// 圆角矩形的圆角
rect.Adjustments.Item(1) = 0.2; // 0~1,值越大越圆
// 插入图片
var pic = slide.Shapes.AddPicture(
"/path/to/image.png", // 文件路径
false, // LinkToFile
true, // SaveWithDocument
100, 100, // Left, Top
400, 300 // Width, Height
);
shape.Left = 100; // 左边距(磅)
shape.Top = 200; // 上边距(磅)
shape.Width = 400; // 宽度(磅)
shape.Height = 300; // 高度(磅)
shape.Rotation = 0; // 旋转角度
shape.Delete(); // 删除单个形状
slide.Delete(); // 删除整页幻灯片
pres.Slides.Item(3).Delete(); // 删除第3页
var sel = Application.ActiveWindow.Selection;
// sel.Type: 0=None, 1=Slides, 2=Shapes, 3=Text
if (sel.ShapeRange) {
for (var i = 1; i <= sel.ShapeRange.Count; i++) {
var s = sel.ShapeRange.Item(i);
// 操作选中形状
}
}
slide.NotesPage.Shapes.Item(2).TextFrame.TextRange.Text = "演讲者备注内容";
| 用途 | RGB 值 | 说明 |
|---|---|---|
| 深蓝(品牌色) | 0x4472C4 | 适合标题/强调 |
| 深灰(正文) | 0x333333 | 正文文字 |
| 浅灰(辅助) | 0x999999 | 副标题/说明 |
| 白色 | 0xFFFFFF | 背景/反色文字 |
| 橙色(强调) | 0xED7D31 | CTA/重点 |
| 绿色(正面) | 0x70AD47 | 增长/完成 |
| 红色(警告) | 0xFF0000 | 下降/警告 |
Scans a codebase for architectural friction, presents candidates as a visual HTML report with before/after diagrams, and guides you through deepening refactors.
npx claudepluginhub claude-office-skills/claude-wps-ppt-plugin