-
WSAndrew77
AskWoody LoungerHello,
If you want to actually disable the command (so that even double-clicking OVR won’t turn it on), put an empty macro named “Overtype” in your Normal.dot template:
Sub Overtype ' do nothing End Sub
HTH
-
WSAndrew77
AskWoody LoungerHello,
If you want to actually disable the command (so that even double-clicking OVR won’t turn it on), put an empty macro named “Overtype” in your Normal.dot template:
Sub Overtype ' do nothing End Sub
HTH
-
WSAndrew77
AskWoody LoungerHow about using a config file?
[&Caption Here] level=1 Position=10 Macro=SomeMacro Divider=TRUE FaceID=1234 [&Another Caption] level=2 Position=9 Macro=SomeOtherMacro Divider=FALSE FaceID=444
You access the values with the System.PrivateProfileString method (more info in the help files on that). That way you could also edit the entries manually with a text editor.
-
WSAndrew77
AskWoody LoungerHow about using a config file?
[&Caption Here] level=1 Position=10 Macro=SomeMacro Divider=TRUE FaceID=1234 [&Another Caption] level=2 Position=9 Macro=SomeOtherMacro Divider=FALSE FaceID=444
You access the values with the System.PrivateProfileString method (more info in the help files on that). That way you could also edit the entries manually with a text editor.
-
WSAndrew77
AskWoody LoungerFrom “RTF: Pocket Guide,” published by (who else) O’Reilly & Associates:
[indent]
Embedding Images
In an ideal world, RTF would allow you to insert a picture into a document by simply dropping a hex-encoded GIF, JPEG, or PNG file into your RTF code. But RTF doesn’t do things that way. The RTF specification, on the subject of pictures, explains a {pict…} construct that contains picture data (typically as a long series of hexadecimal digits). But the picture data encoded in the {pict…} construct is in a binary format that can’t be converted to easily from a conventional image format (i.e., GIF, JPEG, or PNG).
If you want to insert images in an RTF file, you have three options.The first option is to give up and do without the image. In many cases, the image isn’t necessary (as with a company logo on an invoice document).
The second option is to produce the binary encoding of the image by copying it out of an RTF file generated by a word processor. So if you want to insert a logo in an invoice that you’re autogenerating as RTF, you could start AbiWord (for example), start a new blank file, insert a picture from disk, save the file as .rtf, and then open the .rtf file in a text editor. For example, inserting a 2 x 2 blue dot in AbiWord produces an RTF file that ends like this:
pardplainltrpars15{*shppict {pictpngblippicw2pich2picwgoal28pichgoal28 bliptag10000{*blipuid 00000000000000000000000000002710} 89504e470d0a1a0a0000000d4948445200000002000000020403000000809810 1700000030504c54450000008000000080008080000000808000800080808080 80c0c0c0ff000000ff00ffff000000ffff00ff00ffffffffff7b1fb1c4000000 0c49444154789c6338c3700600033401997bc924ce0000000049454e44ae4260 82}}{f4fs24lang1033{*listtag0}}}
This image could be copied into other documents by copying the {pict…} group and inserting it directly into another document as needed. (Note that it must be copied from {pict up to the next matching }, not just the next }. Otherwise, you end up stopping prematurely, at the end of the third line above.)
The third way to insert images in an RTF file is to use this quite nonstandard code to have the word processor insert an arbitrary external image file into the document:{fieldfldedit{*fldinst { INCLUDEPICTURE d "PicturePath" * MERGEFORMATINET }}{fldrslt { }}}
In the PicturePath, path separators must either be a forward slash, like so:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:/stuff/Group_x/images/alaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
or must be a double-backslash, escaped (either as ‘5c’5c or as ), like so:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:'5c'5cstuff'5c'5cGroup_x'5c'5cimages'5c'5calaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
or:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:stuffGroup_ximagesalaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
At time of this writing, this whole image-via-field construct seems to be particular to MSWord versions, beginning with Word 2000. Other word processors either just ignore the construct (as AbiWord, Wordpad, and others do), or they throw an error (like MSWord Viewer 97, which replaces the image with the text “Error! Unknown switch argument”).
You can control exact positioning of an image on the page by simply making it the content of an exact-positioned paragraph, as discussed at the end of the “Basic RTF Syntax” section. For example, this image’s top-left corner starts 2,160 twips across and 3,600 twips down from the page’s top-left corner:{pard pvpgphpg posx2160 posy3600 field...} or {pict...} par}
[/indent]
Sounds like Option 2 might work for you.
BTW, I highly recommend that book if you regulary work in RTF. (Hey, it’s only $12.95)
HTH!
-
WSAndrew77
AskWoody LoungerFrom “RTF: Pocket Guide,” published by (who else) O’Reilly & Associates:
[indent]
Embedding Images
In an ideal world, RTF would allow you to insert a picture into a document by simply dropping a hex-encoded GIF, JPEG, or PNG file into your RTF code. But RTF doesn’t do things that way. The RTF specification, on the subject of pictures, explains a {pict…} construct that contains picture data (typically as a long series of hexadecimal digits). But the picture data encoded in the {pict…} construct is in a binary format that can’t be converted to easily from a conventional image format (i.e., GIF, JPEG, or PNG).
If you want to insert images in an RTF file, you have three options.The first option is to give up and do without the image. In many cases, the image isn’t necessary (as with a company logo on an invoice document).
The second option is to produce the binary encoding of the image by copying it out of an RTF file generated by a word processor. So if you want to insert a logo in an invoice that you’re autogenerating as RTF, you could start AbiWord (for example), start a new blank file, insert a picture from disk, save the file as .rtf, and then open the .rtf file in a text editor. For example, inserting a 2 x 2 blue dot in AbiWord produces an RTF file that ends like this:
pardplainltrpars15{*shppict {pictpngblippicw2pich2picwgoal28pichgoal28 bliptag10000{*blipuid 00000000000000000000000000002710} 89504e470d0a1a0a0000000d4948445200000002000000020403000000809810 1700000030504c54450000008000000080008080000000808000800080808080 80c0c0c0ff000000ff00ffff000000ffff00ff00ffffffffff7b1fb1c4000000 0c49444154789c6338c3700600033401997bc924ce0000000049454e44ae4260 82}}{f4fs24lang1033{*listtag0}}}
This image could be copied into other documents by copying the {pict…} group and inserting it directly into another document as needed. (Note that it must be copied from {pict up to the next matching }, not just the next }. Otherwise, you end up stopping prematurely, at the end of the third line above.)
The third way to insert images in an RTF file is to use this quite nonstandard code to have the word processor insert an arbitrary external image file into the document:{fieldfldedit{*fldinst { INCLUDEPICTURE d "PicturePath" * MERGEFORMATINET }}{fldrslt { }}}
In the PicturePath, path separators must either be a forward slash, like so:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:/stuff/Group_x/images/alaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
or must be a double-backslash, escaped (either as ‘5c’5c or as ), like so:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:'5c'5cstuff'5c'5cGroup_x'5c'5cimages'5c'5calaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
or:
{fieldfldedit{*fldinst { INCLUDEPICTURE d "C:stuffGroup_ximagesalaska_map.gif" * MERGEFORMATINET }}{fldrslt { }}}
At time of this writing, this whole image-via-field construct seems to be particular to MSWord versions, beginning with Word 2000. Other word processors either just ignore the construct (as AbiWord, Wordpad, and others do), or they throw an error (like MSWord Viewer 97, which replaces the image with the text “Error! Unknown switch argument”).
You can control exact positioning of an image on the page by simply making it the content of an exact-positioned paragraph, as discussed at the end of the “Basic RTF Syntax” section. For example, this image’s top-left corner starts 2,160 twips across and 3,600 twips down from the page’s top-left corner:{pard pvpgphpg posx2160 posy3600 field...} or {pict...} par}
[/indent]
Sounds like Option 2 might work for you.
BTW, I highly recommend that book if you regulary work in RTF. (Hey, it’s only $12.95)
HTH!
-
WSAndrew77
AskWoody LoungerWith the cell selected, when you go to Table -> Delete -> Cells, you should be prompted to choose how to accommodate the change. In your case, choose “Shift Cells Left”
HTH,
-
WSAndrew77
AskWoody LoungerWith the cell selected, when you go to Table -> Delete -> Cells, you should be prompted to choose how to accommodate the change. In your case, choose “Shift Cells Left”
HTH,
-
WSAndrew77
AskWoody LoungerHi Gary,
Thanks so much for taking this code for a test drive. I definitely appreciate the feedback. Any chance you could post a (blank) copy of one of those nasty specimens you talked about? I’d love to be able to have something really “bad” to test with while I experiment with your suggestions. In the meantime, I modifed some documents to include styles with names like the ones you encountered. It looks like it’s not an issue of built ins, it’s just inadequate string processing on my part. I never tested with numerals appended to the “char” (Char1, char2, etc.).
The snippet below replaces the more elegant, but inadequate Replace call with some cumbersome but effective good old-fashioned string functions. What I wouldn’t give for built-in regular expressions and variable interpolation!
As for retaining the character formatting, I agree with you on its questionable necessity, but did want to offer it at least as an option.
' Replace this line: 'sStyleReName = Replace(sStyleName, " Char", "") ' ' with this block (new variables declared here for easier reading) ' Dim k As Integer Dim lPos As Long Dim var As Variant var = Split(sStyleName, ",") For k = 0 To UBound(var) lPos = InStr(var(k), " Char") If lPos 0 Then var(k) = Left(var(k), lPos - 1) End If Next k sStyleReName = Join(var, ",")
A more compact, but less readable version without using the lPos variable would be:
... For k = 0 to UBound(var) If InStr(var(k), " Char") 0 Then var(k) = Left(var(k), (InStr(var(k), " Char")) - 1) Next k ...
As an aside for anyone interested, note that even if you’ve set your array base explicitly to 1, variant arrays populated with the Split function are always 0-based. Ditto for using the Array function.
Thanks again, Gary!
-
WSAndrew77
AskWoody LoungerHi Gary,
Thanks so much for taking this code for a test drive. I definitely appreciate the feedback. Any chance you could post a (blank) copy of one of those nasty specimens you talked about? I’d love to be able to have something really “bad” to test with while I experiment with your suggestions. In the meantime, I modifed some documents to include styles with names like the ones you encountered. It looks like it’s not an issue of built ins, it’s just inadequate string processing on my part. I never tested with numerals appended to the “char” (Char1, char2, etc.).
The snippet below replaces the more elegant, but inadequate Replace call with some cumbersome but effective good old-fashioned string functions. What I wouldn’t give for built-in regular expressions and variable interpolation!
As for retaining the character formatting, I agree with you on its questionable necessity, but did want to offer it at least as an option.
' Replace this line: 'sStyleReName = Replace(sStyleName, " Char", "") ' ' with this block (new variables declared here for easier reading) ' Dim k As Integer Dim lPos As Long Dim var As Variant var = Split(sStyleName, ",") For k = 0 To UBound(var) lPos = InStr(var(k), " Char") If lPos 0 Then var(k) = Left(var(k), lPos - 1) End If Next k sStyleReName = Join(var, ",")
A more compact, but less readable version without using the lPos variable would be:
... For k = 0 to UBound(var) If InStr(var(k), " Char") 0 Then var(k) = Left(var(k), (InStr(var(k), " Char")) - 1) Next k ...
As an aside for anyone interested, note that even if you’ve set your array base explicitly to 1, variant arrays populated with the Split function are always 0-based. Ditto for using the Array function.
Thanks again, Gary!
-
WSAndrew77
AskWoody Lounger(Edited by Andrew77 on 29-May-04 03:46. )
Hello,
I’m sure there are other ways, but here’s a quick and dirty method that may get you started.
Sub ProcessParasWithTabs Dim iTabs As Integer Dim rng As Range Dim para As Paragraph For Each para In ActiveDocument.Paragraphs iTabs = 0 Set rng = para.Range Do While InStr(rng.Text, Chr(9)) 0 iTabs = iTabs + 1 rng.MoveStartUntil cset:=Chr(9), Count:=Len(rng.Text) rng.MoveStart unit:=wdCharacter, Count:=1 Loop If iTabs = 3 Then ' Do stuff here ElseIf iTabs = 4 Then ' do stuff here End If Next para End Sub
HTH
Added: A more general function to get the count of any character in a paragraph would be:
Function CharacterCountInPara(para As Paragraph, ByVal char As String) As Integer Dim rng As Range Dim iCount As Integer Set rng = para.Range iCount = 0 char = Left(char, 1) Do While InStr(rng.Text, char) 0 iCount = iCount + 1 rng.MoveStartUntil cset:=char, Count:=Len(rng.Text) rng.MoveStart unit:=wdCharacter, Count:=1 Loop CharacterCountInPara = iCount Set rng = Nothing End Function
Comments welcome.
-
WSAndrew77
AskWoody Lounger(Edited by Andrew77 on 29-May-04 03:46. )
Hello,
I’m sure there are other ways, but here’s a quick and dirty method that may get you started.
Sub ProcessParasWithTabs Dim iTabs As Integer Dim rng As Range Dim para As Paragraph For Each para In ActiveDocument.Paragraphs iTabs = 0 Set rng = para.Range Do While InStr(rng.Text, Chr(9)) 0 iTabs = iTabs + 1 rng.MoveStartUntil cset:=Chr(9), Count:=Len(rng.Text) rng.MoveStart unit:=wdCharacter, Count:=1 Loop If iTabs = 3 Then ' Do stuff here ElseIf iTabs = 4 Then ' do stuff here End If Next para End Sub
HTH
Added: A more general function to get the count of any character in a paragraph would be:
Function CharacterCountInPara(para As Paragraph, ByVal char As String) As Integer Dim rng As Range Dim iCount As Integer Set rng = para.Range iCount = 0 char = Left(char, 1) Do While InStr(rng.Text, char) 0 iCount = iCount + 1 rng.MoveStartUntil cset:=char, Count:=Len(rng.Text) rng.MoveStart unit:=wdCharacter, Count:=1 Loop CharacterCountInPara = iCount Set rng = Nothing End Function
Comments welcome.
-
WSAndrew77
AskWoody Lounger- Go to Tools -> Customize
- Select the Toolbars tab
- Check the box marked “Shortcut menus”
A small toolbar titled “Shortcut menus” should appear, generally near the top left of your screen. Don’t close the Customize dialog yet. - Press the “Text” button on the “Shortcut Menu” toolbar
- Select the “Text” submenu on the Text menu
- Now go back to the Customize dialog, and go to the Commands tab.
- In “Categories” select “Macros”
- In commands, find your new macro
- Click and drag the macro to the text shortcut menu
You can also drag it to any other shortcut menus you’d like it on. You can also remove the “regular” paste from the shortcut menu. - When you’re finished, just close the Customize dialog; the Shortcut menus toolbar will close automatically.
HTH,
-
WSAndrew77
AskWoody Lounger- Go to Tools -> Customize
- Select the Toolbars tab
- Check the box marked “Shortcut menus”
A small toolbar titled “Shortcut menus” should appear, generally near the top left of your screen. Don’t close the Customize dialog yet. - Press the “Text” button on the “Shortcut Menu” toolbar
- Select the “Text” submenu on the Text menu
- Now go back to the Customize dialog, and go to the Commands tab.
- In “Categories” select “Macros”
- In commands, find your new macro
- Click and drag the macro to the text shortcut menu
You can also drag it to any other shortcut menus you’d like it on. You can also remove the “regular” paste from the shortcut menu. - When you’re finished, just close the Customize dialog; the Shortcut menus toolbar will close automatically.
HTH,
-
WSAndrew77
AskWoody LoungerIf you can’t get that Add-In to work, you can make the change yourself in the Registry.
Requisite warning about being careful when editing the registry. Just take it slow. You’re making a real minor change here.
Go to Start -> Run, and Run regedit.exe
Navigate to:
HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0CommonGeneral
Select the “DoNotDismissFileNewTaskPane” key. Change its value from 1 to 0.
Exit regedit and restart Word. Word will now follow whatever setting you have for the Task Pane in Tools->Options->View
HTH
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Thunderbird release notes for 128 esr have disappeared
by
EricB
2 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 hours, 58 minutes ago -
Apple releases 18.5
by
Susan Bradley
3 hours, 17 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
4 hours, 24 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
5 hours, 1 minute ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
11 hours, 58 minutes ago -
No HP software folders
by
fpefpe
12 hours, 43 minutes ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
4 hours, 55 minutes ago -
Stay connected anywhere
by
Peter Deegan
18 hours, 5 minutes ago -
Copilot, under the table
by
Will Fastie
9 hours, 18 minutes ago -
The Windows experience
by
Will Fastie
1 day ago -
A tale of two operating systems
by
Susan Bradley
15 hours, 16 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 5 hours ago -
Where’s the cache today?
by
Up2you2
1 day, 21 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
1 day, 13 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
14 hours, 5 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
1 day, 21 hours ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
2 days, 14 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
2 days, 14 hours ago -
regarding april update and may update
by
heybengbeng
2 days, 15 hours ago -
MS Passkey
by
pmruzicka
1 day, 17 hours ago -
Can’t make Opera my default browser
by
bmeacham
2 days, 23 hours ago -
*Some settings are managed by your organization
by
rlowe44
2 days, 10 hours ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
2 days, 22 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
3 days, 18 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
4 days, 3 hours ago -
AI slop
by
Susan Bradley
1 day, 21 hours ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
4 days, 4 hours ago -
Two blank icons
by
CR2
1 day, 12 hours ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 14 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.