{"id":28733019,"url":"https://github.com/bradsmith1985/managedtom","last_synced_at":"2026-03-11T14:08:42.773Z","repository":{"id":297030756,"uuid":"995415242","full_name":"BradSmith1985/ManagedTOM","owner":"BradSmith1985","description":"Managed wrapper for the Text Object Model (TOM/TOM2).","archived":false,"fork":false,"pushed_at":"2025-06-03T14:19:08.000Z","size":36925,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-15T22:18:03.653Z","etag":null,"topics":["itextdocument","richedit","richtextbox","tom","windows-forms"],"latest_commit_sha":null,"homepage":"https://www.brad-smith.info/blog/projects/textobjectmodel","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BradSmith1985.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,"zenodo":null}},"created_at":"2025-06-03T12:54:53.000Z","updated_at":"2025-06-03T14:19:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8b0f782-a2a6-4b93-a148-99eeb77a74d3","html_url":"https://github.com/BradSmith1985/ManagedTOM","commit_stats":null,"previous_names":["bradsmith1985/managedtom"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BradSmith1985/ManagedTOM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradSmith1985%2FManagedTOM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradSmith1985%2FManagedTOM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradSmith1985%2FManagedTOM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradSmith1985%2FManagedTOM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BradSmith1985","download_url":"https://codeload.github.com/BradSmith1985/ManagedTOM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradSmith1985%2FManagedTOM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271394204,"owners_count":24751859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["itextdocument","richedit","richtextbox","tom","windows-forms"],"created_at":"2025-06-15T22:00:41.623Z","updated_at":"2026-03-11T14:08:42.722Z","avatar_url":"https://github.com/BradSmith1985.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ManagedTOM\n\u003csmall\u003e*Previously known as **TOM Classes for .NET***\u003c/small\u003e\n\nA managed wrapper for the Text Object Model (TOM/TOM2).\n\n## About\n**ManagedTOM** is a managed assembly, written in C++/CLI, that provides a set of wrapper classes for the Text Object Model (TOM) interfaces. This allows .NET developers to access the functionality of the native `ITextDocument` interface without the need to use dynamic programming or COM interop. The assembly includes the following classes:\n\n- `TextDocument` (`ITextDocument`)\n- `TextRange` (`ITextRange`)\n- `TextSelection` (`ITextSelection`)\n- `TextFont` (`ITextFont`)\n- `TextPara` (`ITextPara`)\n- `TextStoryRanges` (`ITextStoryRanges`)\n\n## Why use TOM?\nThe Text Object Model exposes some additional features when compared to working directly with a `RichTextBox` control in Windows Forms, as well as offering better performance when manipulating documents.\n\n## TOM 2 support\nThe latest version includes support for TOM 2 (available on Windows 8 and higher). Each of the above classes wraps both the TOM 1 and TOM 2 interfaces (e.g. `ITextDocument` and `ITextDocument2`), and will automatically select the best available version. In addition, TOM 2 adds the following classes:\n\n- `TextStory` (`ITextStory`)\n- `TextRow` (`ITextRow`)\n- `TextStrings` (`ITextStrings`)\n\n## Also included\n- `RichTextBoxEx` – an extended version of the Windows Forms `RichTextBox` control which automatically loads the newest available version of the native RichEdit control (required for advanced functionality).\n- `TextExtensions` – provides extension methods for working with ranges using a more familiar syntax, as well as conversion of math text to OMML and MathML.\n\n## Requirements\n- .NET Framework 4.8\n- Windows Vista or higher\n- Visual C++ Redistributable for Visual Studio v14\n\n## Instructions\n- If you don't want to build from source, download the binaries for the latest release.\n- To use the TOM classes in your code, simply reference the `ManagedTOM2.dll` assembly (x86 or x64) in your project.\n- IntelliSense documentation is included, as well as a compiled help (`.chm`) file for easy API reference.\n\n## Frequently Asked Questions\n- *What are the requirements for accessing the TOM2 functionality?*\u003cbr /\u003e\nYou must obtain the `TextDocument` object from a RICHEDIT50W control. This control ships with Windows 8 and newer, however the Windows Forms `RichTextBox` control will only use RICHEDIT20W by default. Use the included `RichTextBoxEx` control to load the newer version.\n- *Why does `TextRange.ToMathML()` throw a `NotSupportedException`?*\u003cbr /\u003e\nThis method requires the `TextDocument` object to be obtained from the RICHEDIT60W control included with Microsoft Office.\n- *Why is a `BadImageFormatException` thrown when trying to load the assembly?*\u003cbr /\u003e\nThe processor architecture of the entry assembly must match that of the `ManagedTOM2.dll` assembly. You can build it for x86 or x64, but I advise against using 'Any CPU' as this could behave differently at run-time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsmith1985%2Fmanagedtom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradsmith1985%2Fmanagedtom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsmith1985%2Fmanagedtom/lists"}