-
WSrhadin
AskWoody LoungerThank you, again, Richard. I haven’t had a chance to try the revised code or even to work with it — I’m sorry to say that earning my paycheck is distracting me from what I’d rather be doing, which is working on the macros. I probably won’t be able to get back to the macros until the weekend. Yes, this will be an auxiliary macro until I can merge the files.
I would, however, like an answer to my original question — a “yes” or “no” will do: Can an interface like I originally asked about be done? I would like to know just to satisfy my curiosity. I am grateful for all the help I have been given and the solutions suggested are the ones I will implement (with some tinkering), but no one has said “Yes, the interface can be done but . . .” or “No, VBA won’t let you create such a solution because . . .” or whatever the appropriate answer is. Thanks.
-
WSrhadin
AskWoody LoungerThanks, Richard, for the suggestion and the starting code. I have a couple of questions (which will reveal how little I understand VBA
).
1. Why is the underscore needed in the Key as in due_to?
2. Is there a limit to the size of an .ini file (except for it becoming too cumbersome), or is it just like a .txt file? By size limit, I mean a maximum number of entries (e.g., a custom dictionary is limited to 5,000 entries).
3. I note that there is no space on either side of the =. Is this required or can there be a space?I tried your code as is but am unable to get it to work properly. It does delete the existing word, but does not replace it with the new word — it simply leaves the space empty. Something for me to check into.
-
WSrhadin
AskWoody LoungerThanks, Hans.
I will use this code as a starting point. I tried it and it works as you said. I appreciate the help. This will give something to do over the next few weeks.
-
WSrhadin
AskWoody LoungerThanks for the suggestion, but it does not apply to these particular macros — at least I don’t think it does. There seems to be a continuing misunderstanding about the macros for which I want the interface: they are not search (or find and replace) macros. The macros are used as the editor reads the manuscript and are designed to facilitate making editing changes based on context, by which I mean that the editor has to consider context and style in deciding whether a particular term is properly used.
Consider as an example the words “since” and “because”. You cannot do a find and replace to change every instance of “since” to “because” because the determination of which is correct depends on its use in context. They both have a causal sense, so in common English they are used interchangeably to convey a causal connection (“since the virus produces symptoms”, “because the virus produces symptoms”), but grammatically there is a distinction and “since” is used to convey a sense of time (“since he turned 18 he has lived alone”) and “because” to convey a causal connection (“because he turned 18 he could legally drink alcohol”). Consider the difference in meaning that occurs when replacing “since” with “because” in this example: “because he turned 18 he has lived alone”. Which does the author mean: the cause of his living alone was that he turned 18 or he has lived alone from the time he turned?
My point is that the toggle macros serve a different purpose than a search macro and cannot (should not) be used in the same manner. It has been suggested that a find and replace macro that asks each time whether to make a change would work, and it will for some things, but not for what the toggle macros are intended to do. Additionally, if you had to run through a list of 50 terms in a 125-page document answering yes or no regarding replacement, the edting time would increase dramatically and the number of errors introduced would increase.
OTOH, if there is a way to adapt the suggestion of having the terms in a .txt file rather than as part of the VBA macro yet essentially work the same (i.e., as a toggle rather than as a search and replace), I am open to that; in fact, I think that would probably work better, especially because words and phrases could easily be added to a .txt file. But I admit that I don’t know how to write the toggle macro so that the user could place her cursor in a word or could select a phrase and have the macro compare the word/selection against the contents of the .txt file and if found, replace the word/selection with an alternative. This warrants further investigation.
-
WSrhadin
AskWoody LoungerThe more I think about your two macros, NeuroDoc, the more intrigued I am. I think your suggestion would be useful, but for a different task than the toggle macros. I know that it seems as if a F&R macro should work, but it doesn’t — we have tried that in the past, although not with option to change or not change.
Would you be willing to share with me the code you use for both the macro and the add-to-list dialog box? When a word is added to the list via your dialog box, will the word/phrase be included in the search the next time the macro is run or do you have to exit and restart Word? Can your macro deal with punctuation? For example, could I enter J. Cardiovasc. Surg. as the find phrase or microbally-derived or are there limitations as to how the find phrase is constructed? Is it case sensitive? Is there a limit as to the number of words or phrases that can be in the Find list?
-
WSrhadin
AskWoody LoungerThanks for the suggestion, NeuroDoc, but the macro you suggest is essentially a find and replace macro. The macro would work great if we were correcting misspellings or something that doesn’t require making a decision based on context. The toggle macros are based on grammar decisions made in context. For example, if it were always incorrect to use “principal” because in every instance “principle” was meant, the macro you suggest would work fine. But consider this:
“The principal’s principles were immoral and the assistant principal did nothing to correct those principles.”
Any change has to be decided in context — the context not only of the current sentence, but of the preceding and succeeding sentence.
-
WSrhadin
AskWoody LoungerHans, autotext doesn’t accomplish the same thing with the ease of the macro. In addition there are usability limitations. Consider the following. In the sample code I provided, if the editor comes to a sentence that reads, for example,
“the distance between the patient’s eyes was 2.5 centimeters”
to change “centimeters” to “cm”, the editor simply puts her cursor somewhere in the word “centimeters” and presses the activation key (which is a single key) . With AutoText, the editor has to (a) select the word to be replaced, (
open the AutoText menu, © find the correct main menu, (d) find the correct submenu, perhaps having to go through several, and (e) select the correct replacement and click it. As the number of entries increases, the time it takes to find the replacement text increases.
Also, consider the variations. Some combinations require multiple variations. For example, the “which” and “that” combination has 4 possibilities: that > which; which > that; That > Which; and Which > That. The “principal” and “principle” combination has 8 possibilities principal > principle; Principal > Principle; principals > principles; Principals > Principles; principle > principal; Principle > Principal; principles > principals; and Principles > Principals. As you can see, the list can grow. Consequently, it is much quicker to press a single key than to use AutoText.
-
WSrhadin
AskWoody LoungerI am not concerned about the “aberrations” such as the superscripting because that occurs infrequently. If an interface can be done that would just handle the straight text, that would be perfect. The usual entries have no superscripting or subscripting, which would be the only variations from straight text in any case. What I really want is for the enduser to have a box that says, e.g.,
Change [word] of [number] characters
To [word]Add to: [checkbox] General Words
[checkbox] Medical Acronyms
[checkbox] [other macro choices]Add Cancel
and then have automatically added to the checked macro and in the correct place the following code with the information filled in:
ElseIf target = “[change word]” Then
ActiveDocument.Range(Start:=aaa, End:=aaa + [number of characters]).Delete
Selection.TypeText Text:=”[to word]”Of ocurse, it would be even better if the enduser didn’t have to provide the character count, that the macro could provide it automatically.
Is this interface possible?
-
WSrhadin
AskWoody LoungerThank you, Jan. I appreciate the code that I can use as a guide. It is clear that I have a very long way to go for even a semblance of mastering VBA.
-
WSrhadin
AskWoody LoungerThanks, Stuart. I will search the WithEvents as you suggest. I haven’t yet used application events, so it will be a new adventure for me.
-
WSrhadin
AskWoody LoungerThank you, Hans. I just looked at post 538,061 and see that it uses the FolderPicker. I had tried to write my macro using FolderPicker, but I had been unable to figure out how to get it to retain the selected folder name. I see that my error was in the If . . . End If statement. I appreciate your leading me to this code.
I also thank you for the InputBox code. Again I had tried using the InputBox but I had it completely backwards, which is why I couldn’t get it to work and why I assumed I was trodding down the wrong path.
As for the third item, that I had no clue about, so thank you a third time.
I much appreciate the help you have been giving me. I do learn each time and I always try to solve the problem before I ask for help on the forum. I hope someday to be able to return the favors by being in a position to offer help to others.
-
WSrhadin
AskWoody LoungerPerfectly, Hans. Again, I thank you.
-
WSrhadin
AskWoody LoungerThanks, Jeremy, but I can’t duplicate the task that way.
-
WSrhadin
AskWoody LoungerHans,
I know it doesn’t seem to make sense but in fact it does accomplish something.
In an earlier request for help, you provided VBA code that would reload a custom dictionary after adding a word to it so that the word would no longer be considered misspelled. Although the dictionary reloads, the red squiggles indicating that the word is misspelled do not disappear unless I right-click on the word. This is what I am trying to accomplish — simulating my right-clicking on the word.
I tried to approach it by writing code to select IgnoreAll before selecting the word for inclusion in the custom dictionary, but I was unable to figure out code that would accomplish that task.
-
WSrhadin
AskWoody LoungerThank you, Hans.
The code you provided works (I only had to change the ? in the two Select Case MsgBox statements to _). After reading it, I can tell you that I was so far off in my coding that I shouldn’t even call what I had done coding.
With this core code, I think I can finish writing the code for the macro — I will give it a try. I appreciate the help and the quick response.
Rich
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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
-
Network Issue
by
Casey H
5 hours, 7 minutes ago -
Fedora Linux is now an official WSL distro
by
Alex5723
10 hours, 34 minutes ago -
May 2025 Office non-Security updates
by
PKCano
11 hours, 1 minute ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
12 hours, 56 minutes ago -
pages print on restart (Win 11 23H2)
by
cyraxote
12 hours, 12 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
15 hours, 8 minutes ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
15 hours, 9 minutes ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
22 hours, 31 minutes ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
6 hours, 53 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
1 day, 9 hours ago -
How much I spent on the Mac mini
by
Will Fastie
9 hours, 17 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
4 hours, 27 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
1 day, 15 hours ago -
Setting up Windows 11
by
Susan Bradley
10 hours, 47 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
1 day, 11 hours ago -
Powershell version?
by
CWBillow
1 day, 12 hours ago -
SendTom Toys
by
CWBillow
8 hours, 38 minutes ago -
Add shortcut to taskbar?
by
CWBillow
1 day, 16 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
2 days, 8 hours ago -
How can I install Skype on Windows 7?
by
Help
2 days, 7 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
1 day, 14 hours ago -
We live in a simulation
by
Alex5723
2 days, 22 hours ago -
Netplwiz not working
by
RetiredGeek
2 days, 9 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
3 days, 10 hours ago -
Microsoft is killing Authenticator
by
Alex5723
12 hours, 47 minutes ago -
Downloads folder location
by
CWBillow
3 days, 17 hours ago -
Remove a User from Login screen
by
CWBillow
2 days, 13 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
3 days, 8 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
3 days, 8 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
1 day, 10 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.