Solved

Need VBA solution for autotext replacement like Phrase Express or Robotype

Posted on 2014-01-05
6
808 Views
Last Modified: 2014-01-07
I want a custom text expansion/autotext function for my Microsoft Office applications. I can't load outside programs such as PC Magazines Robotype, to my work computer because of IT policy. However, I do have VBA available.

I'd like to develop an autotext function with vba.  I know about the Word function for this task but I don't like how it's implemented.  I'd like a separate database for custom text expansion or boilerplate text expansion rather than having my custom stuff mixed in with the Word stuff.

I was thinking about an array of my custom abbreviations with replacements.  Better yet, the array would read from an Access table.

The trigger would be that when the spacebar is pressed after a defined autotext element/record, the replacement text would be typed immediately rather than completing a document and doing a find/replace.  This is how RoboType works.

I am willing to learn some VBA to do this, I need to know some general concepts as to how to get this done and then figure out the details as I go.
0
Comment
Question by:rreiss60
6 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 260 total points
Comment Utility
I have done the same thing using this VBA code:

MS Access™ 97 / 2000 / 2007 Spell Checker / Dictionary Tool with Source Code

http://www.pcesoft.com/Access-Spell-Checker-Tool-Source-Code.html
You can download the source code for our MS Access™ Spell Checker for either the MS Access 97™, MS Access 2000™ or MS Access 2007™ versions for FREE. If you find the code useful, please use the Donate button below. Our Spell-Checker solves the problem of how to distribute the Spell-Checker ability in your applications (Access does not include a spell checker which runs in runtime mode. Our spell checker DOES run in runtime mode, giving your users a useful spell checker in your Access runtime distribution!). We offer a complete Access 97, Access 2000 or Access 2007 spell check solution, with source code!

The Access Team Blog also mentioned it here: http://blogs.office.com/b/microsoft-access/archive/2008/09/04/open-source-spell-check-for-the-runtime.aspx
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 100 total points
Comment Utility
There is an AutoCorrect option in all Office applications that can do that.

It's in the Tools menu. Any changes you make to the list of AutoCorrect options is saved in a .acl file that is kept in the following directory on my Windows8 computer (probably at the same place since Vista): C:\Users\<username>\AppData\Roaming\Microsoft\Office.

This file can be distributed between computers and users.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 40 total points
Comment Utility
for my Microsoft Office applications.
Do you mean for all your Office apps, or just for Access.

VBA works for specific applications, and for specific "documents" in those applications - that is, a VBA function I write in Acccess would work in that specific Access database. It would not function for other Access databases, unless I copied that code over to the second database. Similarly, it would also not work in an Excel  workbook, or a Word document, unless I copied that code over and set up that Workbook or Document to fire off that code based on some event.

In other words - VBA cannot run in a stand-alone mode. It must be run within the context of an application (after all, it's not known as Visual Basic for Applications for nothing).
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Closing Comment

by:rreiss60
Comment Utility
Yes, I plan to use it with Microsoft applications.  I was hoping that the abbreviation and replacement text could reside in a table in Access and be called by the VBA running in Word.
0
 
LVL 84
Comment Utility
Word can connect into an Access database quite easily. Just include a reference to the DAO library, or the Microsoft Access Object library for 2007/2010, and use code like this to open the table:

Dim dbs As DAO.Database
Set dbs = OpenDatabase("Full path to your Access database")

If you do this when you open your Word document, then you'd have a connection to your Access database, and could use that "dbs" object to get the information from your table.

Of course, you'd have to do this for every document. You could create a Template, or modify the Normal template, to include this code. But it wouldn't work for document you receive from others, unless you copy/paste your "autotext" code into the relevant events for that document.
0
 

Author Comment

by:rreiss60
Comment Utility
Thank you.
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 article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

728 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

9 Experts available now in Live!

Get 1:1 Help Now