Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

In Microsoft Word, what is autocorrect VBA equivalent.

With regard to Microsoft Word, I have read in these forums that the spacebar by itself cannot be used to launch a macro.

But, isn't that what autocorrect does?  You can add a key board abbreviation like "txt" and its replacment, "replacement text" to the autocorrect dictionary/library. Then, while in the document, typing "txt" and hitting spacebar does the replacement while keeping the usual functionality of the spacebar as you go.

What is going on from a VBA coding perspective?
0
rreiss60
Asked:
rreiss60
  • 2
1 Solution
 
GrahamSkanCommented:
Basically, nothing. The only thing that runs is Word's internal coding in the .exe or a .dll.

Generally VBA sits outside of Word. However the Word designers have provided access to some of the Word objects, properties, methods and events.

It is possible to use VBA to run the methods on the applicable properties of an object. It is also possible to use an event to start a macro procedure. But, as we have said before, there is no event available for typing into a document, so no macro can be started.
0
 
GrahamSkanCommented:
Thanks.

Since that answer, I did some further research. I don't have VSTO (I can't afford it) so I tried searching to see if it can do any better.

As you will see from this link:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/f3ce678b-946c-4995-9b50-2b6d8b9fd8ba/vsto-event-for-word-documents-contenttext-changes?forum=vsto
it seems not, but the page points to using Windows API calls. These can be used in VBA, but as it might get rather difficult, I haven't yet been any further.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now