Solved

Need VBA solution for autotext replacement like Phrase Express or Robotype

Posted on 2014-01-05
6
820 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 260 total points
ID: 39757510
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
ID: 39758013
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
ID: 39758016
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:rreiss60
ID: 39758299
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
ID: 39758912
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
ID: 39762164
Thank you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

730 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