--- id: malue-ai/dazee-small/onenote version: "1e3f5e29" license: MIT install: manual updated: 2026-03-18 --- # onenote — Automate OneNote operations on Windows through PowerShell COM objects. Build new pages, search across notebooks, and organize sections without manual interaction. Requires the desktop version of OneNote and user confirmation before modifying content. Publisher: malue-ai · Stars: 35 · Updated: 2026-03-18 Install (manual): `git clone https://github.com/malue-ai/dazee-small` ## SKILL.md # OneNote 笔记管理(Windows) 通过 PowerShell 控制 Windows 上的 Microsoft OneNote。 ## 使用场景 - 用户说「帮我在 OneNote 里新建一页笔记」「搜一下 OneNote 里关于 XXX 的笔记」 - 用户需要查看或整理 OneNote 内容 ## 命令参考 ### 列出笔记本 ```powershell $onenote = New-Object -ComObject OneNote.Application [xml]$hierarchy = "" $onenote.GetHierarchy("", [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsNotebooks, [ref]$hierarchy) $hierarchy.Notebooks.Notebook | ForEach-Object { Write-Output "📓 $($_.name)" $_.Section | ForEach-Object { Write-Output " 📑 $($_.name)" } } ``` ### 搜索笔记 ```powershell $onenote = New-Object -ComObject OneNote.Application [xml]$results = "" $onenote.FindPages("", "搜索关键词", [ref]$results) $results.Pages.Page | ForEach-Object { Write-Output "$($_.name) — $($_.dateTime)" } ``` ### 创建新页面 ```powershell $onenote = New-Object -ComObject OneNote.Application # 获取目标 Section ID [xml]$hierarchy = "" $onenote.GetHierarchy("", [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsSections, [ref]$hierarchy) $sectionId = ($hierarchy.Notebooks.Notebook.Section | Where-Object { $_.name -eq "目标分区" }).ID # 创建页面 $pageXml = @" "@ $onenote.CreateNewPage($sectionId, [ref]$null) ``` ## 注意 - 需要安装桌面版 OneNote(非 UWP 版本) - COM 对象操作需要 OneNote 进程运行中 - 首次使用可能需要用户授权 ## 安全规则 - **不删除笔记本或分区** - 创建/修改操作前展示内容让用户确认 [View on SkillFed](https://skillfed.io/malue-ai/dazee-small/onenote) · [View on GitHub](https://github.com/malue-ai/dazee-small)