Solved

In Microsoft Word, what is autocorrect VBA equivalent.

Posted on 2014-01-18
2
500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Outlook Free & Paid Tools
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

830 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