Solved

In Microsoft Word, what is autocorrect VBA equivalent.

Posted on 2014-01-18
2
480 Views
Last Modified: 2014-01-18
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
Comment
Question by:rreiss60
  • 2
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 400 total points
ID: 39790775
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39791135
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This collection of functions covers all the normal rounding methods of just about any numeric value.
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now