{"id":620,"date":"2023-03-26T17:09:38","date_gmt":"2023-03-27T00:09:38","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/math-in-office\/?p=620"},"modified":"2023-03-28T09:13:35","modified_gmt":"2023-03-28T16:13:35","slug":"itextdocument2-setproperty-and-getproperty","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/math-in-office\/itextdocument2-setproperty-and-getproperty\/","title":{"rendered":"ITextDocument2 SetProperty and GetProperty"},"content":{"rendered":"<p>These methods allow programmers to set and get document properties for RichEdit controls. There is some <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/tom\/nf-tom-itextdocument2-getproperty\">documentation<\/a> on the web, but more detail can be helpful and new properties have been added. This post describes the current set of properties except for the math properties, which are described in the post <a href=\"https:\/\/learn.microsoft.com\/en-us\/archive\/blogs\/murrays\/default-document-math-properties\">Default Document Math Properties<\/a>.<\/p>\n<table style=\"width: 96.8208%; height: 2059px;\">\n<tbody>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\"><strong>Property ID<\/strong><\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\"><strong>Property Value<\/strong><\/td>\n<td style=\"width: 33.6209%;\"><strong>ID def<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomAlignWithTrailSpace<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: if true, paragraph center alignment includes trailing spaces.<\/td>\n<td style=\"width: 33.6209%;\">0x92<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomAnimateImages<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: if true, enable <a href=\"https:\/\/learn.microsoft.com\/en-us\/archive\/blogs\/murrays\/richedit-animated-gifs\">GIF animation<\/a>. Must be a DWrite control.<\/td>\n<td style=\"width: 33.6209%;\">0x96<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomCanCopy<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Get: true if either the current selection isn\u2019t protected or an EN_PROTECTED query returns S_OK<\/td>\n<td style=\"width: 33.6209%;\">0x89<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomCanRedo<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Get: true if redo entries exist<\/td>\n<td style=\"width: 33.6209%;\">0x8A<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomCanUndo<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Get: true if undo entries exist<\/td>\n<td style=\"width: 33.6209%;\">0x8B<\/td>\n<\/tr>\n<tr style=\"height: 163px;\">\n<td style=\"width: 36.7783%; height: 163px;\" width=\"218\">tomDocAlignPlainTextBaseLine<\/td>\n<td style=\"width: 55.4617%; height: 163px;\" width=\"383\">Set\/Get: if true, align plain-text baselines on lines with fonts of different ascents and descents which may occur, for example, with mixtures of Latin and Asian fonts. Such alignment increases the line height.<\/td>\n<td style=\"width: 33.6209%;\">0xA0<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomDocAutoLink<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: same value definitions as for wparam of <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/controls\/em-autourldetect\">EM_AUTOURLDETECT<\/a><\/td>\n<td style=\"width: 33.6209%;\">0x8D<\/td>\n<\/tr>\n<tr style=\"height: 131px;\">\n<td style=\"width: 36.7783%; height: 131px;\" width=\"218\">tomDocColorFlags<\/td>\n<td style=\"width: 55.4617%; height: 131px;\" width=\"383\">Set\/Get: if value = tomDocDisableColorCompare (1), disable RichEdit color render fixups when back color and text colors are too similar. Used mostly for transparent controls.<\/td>\n<td style=\"width: 33.6209%;\">0xA2<\/td>\n<\/tr>\n<tr style=\"height: 195px;\">\n<td style=\"width: 36.7783%; height: 195px;\" width=\"218\">tomDocConverterFlags<\/td>\n<td style=\"width: 55.4617%; height: 195px;\" width=\"383\">Set\/Get: a set of flags. tomUseTomMmlWriter (1) uses the TOM MathML\/OMML writer instead of the HTML writer. tomWriteSelAttributes (2) writes <a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/mathml-and-omml-user-selection-attributes\/\">selection attributes<\/a> in MathML\/OMML. tomNoMmlPrefix (4) suppresses the mml: prefix in MathML. tomNoIndent (8) doesn\u2019t indent MathML or OMML.<\/td>\n<td style=\"width: 33.6209%;\">0x98<\/td>\n<\/tr>\n<tr style=\"height: 99px;\">\n<td style=\"width: 36.7783%; height: 99px;\" width=\"218\">tomDocDefaultTabSize<\/td>\n<td style=\"width: 55.4617%; height: 99px;\" width=\"383\">Set\/Get: value equals #columns of a default tab, where the column width is given by the width of a space.<\/td>\n<td style=\"width: 33.6209%;\">0xA1<\/td>\n<\/tr>\n<tr style=\"height: 163px;\">\n<td style=\"width: 36.7783%; height: 163px;\" width=\"218\">tomDocImageFlags<\/td>\n<td style=\"width: 55.4617%; height: 163px;\" width=\"383\">Set\/Get: if value = tomNoImageHandles (1), don&#8217;t display sizing handles on a selected image. If value = tomEnableD2DPreviewZoom (2), enable print-preview zoom for D2D\/DWrite controls and <a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/richeditd2d-window-controls\/\">RichEditD2D<\/a>[PT] window controls.<\/td>\n<td style=\"width: 33.6209%;\">0x99<\/td>\n<\/tr>\n<tr style=\"height: 99px;\">\n<td style=\"width: 36.7783%; height: 99px;\" width=\"218\">tomDocNoMfenced<\/td>\n<td style=\"width: 55.4617%; height: 99px;\" width=\"383\">Set\/Get: if value = tomNoMfenced (1), MathML writer writes &lt;mrow&gt; element equivalent to &lt;mfenced&gt;. The latter isn\u2019t supported in MathML core.<\/td>\n<td style=\"width: 33.6209%;\">0x97<\/td>\n<\/tr>\n<tr style=\"height: 163px;\">\n<td style=\"width: 36.7783%; height: 163px;\" width=\"218\">tomDocShowUnicodeControls<\/td>\n<td style=\"width: 55.4617%; height: 163px;\" width=\"383\">Set\/Get: if value = tomShowUnicodeControls (1), display special zero-width glyphs for Unicode Bidi controls and ZWJ (U+200D used in family emoji). For more detail, see the section \u201cShow Unicode control characters mode and emoji\u201d in the Notepad <a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/windows-11-notepad\/\">post<\/a>.<\/td>\n<td style=\"width: 33.6209%;\">0x9A<\/td>\n<\/tr>\n<tr style=\"height: 99px;\">\n<td style=\"width: 36.7783%; height: 99px;\" width=\"218\">tomDocSpaceBefore<\/td>\n<td style=\"width: 55.4617%; height: 99px;\" width=\"383\">Set\/Get: value gives vertical space before start of document. For an example, see the section \u201cFind\/Replace dialog drop down\u201d in the Notepad <a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/windows-11-notepad\/\">post<\/a>.<\/td>\n<td style=\"width: 33.6209%;\">0x9B<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomDocSpaceBeforeMax<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Set\/Get: maximum document space before<\/td>\n<td style=\"width: 33.6209%;\">0x9D<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomDocSpaceBeforeMin<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Set\/Get: minimum document space before<\/td>\n<td style=\"width: 33.6209%;\">0x9C<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomDocViewFlags<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: if value = tomDocViewNoInsetZoom (1), don\u2019t zoom the window inset when the content is zoomed.<\/td>\n<td style=\"width: 33.6209%;\">0x9E<\/td>\n<\/tr>\n<tr style=\"height: 131px;\">\n<td style=\"width: 36.7783%; height: 131px;\" width=\"218\">tomEllipsisMode<\/td>\n<td style=\"width: 55.4617%; height: 131px;\" width=\"383\">Set\/Get: value can be ELLIPSIS_NONE (0) ellipsis disabled, ELLIPSIS_END (1) ellipsis at the end (forced break), or ELLIPSIS_WORD (3) ellipsis at the end (word break)<\/td>\n<td style=\"width: 33.6209%;\">0x8E<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomEllipsisState<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Get: if true, the display ends with an ellipsis.<\/td>\n<td style=\"width: 33.6209%;\">0x8F<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomEncloseSurroundSpacing<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: value is extra spacing in twips before and after an <a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/rounded-rectangles-and-ellipses\/\">Enclose object<\/a>.<\/td>\n<td style=\"width: 33.6209%;\">0x93<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomIgnoreTrailSpacing<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: if true, don\u2019t include added intercharacter spacing for the last character in a line.<\/td>\n<td style=\"width: 33.6209%;\">0x95<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomRichText<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Get: if true, control is a rich-text control.<\/td>\n<td style=\"width: 33.6209%;\">0x94<\/td>\n<\/tr>\n<tr style=\"height: 67px;\">\n<td style=\"width: 36.7783%; height: 67px;\" width=\"218\">tomUndoLimit<\/td>\n<td style=\"width: 55.4617%; height: 67px;\" width=\"383\">Set\/Get: same value definitions as for wparam of <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/controls\/em-setundolimit\">EM_SETUNDOLIMIT<\/a><\/td>\n<td style=\"width: 33.6209%;\">0x8C<\/td>\n<\/tr>\n<tr style=\"height: 35px;\">\n<td style=\"width: 36.7783%; height: 35px;\" width=\"218\">tomUnderlineTrailSpace<\/td>\n<td style=\"width: 55.4617%; height: 35px;\" width=\"383\">Set\/Get: if true, underline trail spaces.<\/td>\n<td style=\"width: 33.6209%;\">0x91<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>These methods allow programmers to set and get document properties for RichEdit controls. There is some documentation on the web, but more detail can be helpful and new properties have been added. This post describes the current set of properties except for the math properties, which are described in the post Default Document Math Properties. [&hellip;]<\/p>\n","protected":false},"author":40611,"featured_media":55,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-math-in-office"],"acf":[],"blog_post_summary":"<p>These methods allow programmers to set and get document properties for RichEdit controls. There is some documentation on the web, but more detail can be helpful and new properties have been added. This post describes the current set of properties except for the math properties, which are described in the post Default Document Math Properties. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/users\/40611"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/media\/55"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}