{"id":16105767,"url":"https://github.com/devlights/gord","last_synced_at":"2026-02-11T03:03:07.123Z","repository":{"id":193172994,"uuid":"688276621","full_name":"devlights/gord","owner":"devlights","description":"Gord is a library to operate MS Word using go-ole library.","archived":false,"fork":false,"pushed_at":"2024-09-10T07:52:12.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-24T15:04:52.071Z","etag":null,"topics":["go","golang","win32com","windows","word"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlights.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T02:42:52.000Z","updated_at":"2025-03-31T08:12:54.000Z","dependencies_parsed_at":"2024-10-27T17:27:37.556Z","dependency_job_id":"9875d551-8f4a-42eb-9b3b-8dc521a33319","html_url":"https://github.com/devlights/gord","commit_stats":null,"previous_names":["devlights/gord"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/devlights/gord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlights%2Fgord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlights%2Fgord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlights%2Fgord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlights%2Fgord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlights","download_url":"https://codeload.github.com/devlights/gord/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlights%2Fgord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29326078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T02:08:56.257Z","status":"ssl_error","status_checked_at":"2026-02-11T02:08:51.338Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","win32com","windows","word"],"created_at":"2024-10-09T19:10:34.459Z","updated_at":"2026-02-11T03:03:07.105Z","avatar_url":"https://github.com/devlights.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gord\nGord is a library to operate MS Word using go-ole library. Thanks [go-ole](https://github.com/go-ole/go-ole) package!\n\nThis library works only on Windows.\n\n## Install\n\n```sh\ngo get github.com/devlights/gord@latest\n```\n\n## Usages\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/devlights/gord\"\n)\n\ntype (\n\tfilePath = string\n)\n\n// main is entry point of this app.\nfunc main() {\n\tif len(os.Args) \u003c 2 {\n\t\t_, _ = fmt.Fprintf(os.Stderr, \"need file-path\")\n\t\tos.Exit(1)\n\t}\n\n\tif err := run(os.Args[len(os.Args)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc run(p filePath) error {\n\t// 0. Initialize Gord\n\tquitFn := gord.MustInitGord()\n\tdefer quitFn()\n\n\t// 1. Create new Gord instance.\n\tg, release := gord.MustNewGord()\n\n\t// must call gord release function when function exited\n\t// otherwise WORD process was remained.\n\tdefer release()\n\n\t// optional settings\n\tg.MustSetVisible(true)\n\n\t// 2. Get Documents instance.\n\tdocs, err := g.Documents()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// 3. Open document\n\tdoc, docReleaseFn, err := docs.Open(p)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// call document's release function\n\tdefer docReleaseFn()\n\n\t// simulate something processing..\n\ttime.Sleep(5 * time.Second)\n\n\t// 4. Close document\n\tif err := doc.Close(); err != nil {\n\t\treturn err\n\t}\n\n\t// Document::SetSaved(true) and Document::Close() is automatically called when `defer docReleaseFn()`.\n\t// Word::Quit() and Word::Release() is automatically called when `defer release()`.\n\n\treturn nil\n}\n```\n\nAlso look at the \"examples\" directory :)\n\n## REFERENCES\n\n- [Word VBA リファレンス](https://learn.microsoft.com/ja-jp/office/vba/api/overview/word)\n- [列挙体 (Word)](https://learn.microsoft.com/ja-jp/office/vba/api/word(enumerations))\n- [Word オブジェクト モデルの概要](https://learn.microsoft.com/ja-jp/visualstudio/vsto/word-object-model-overview?view=vs-2022\u0026tabs=csharp)\n\n## See also\n\n- [Goxcel](https://github.com/devlights/goxcel)\n  - Goxcel is a library to operate Excel using go-ole library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlights%2Fgord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlights%2Fgord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlights%2Fgord/lists"}