Solved

VBScript - Amend Word Autocomplete list

Posted on 2008-10-13
1
695 Views
Last Modified: 2012-06-21
Good afternoon,

How can I amend the Microsoft Word 2003 Autocomplete list using a VBScript? I want to remove an existing entry and replace.

Michael
0
Comment
Question by:Barnardos_2LS
1 Comment
 
LVL 1

Accepted Solution

by:
Barnardos_2LS earned 0 total points
ID: 22713030
I resolved the issue with the attached code.


'Function to replace a Microsoft Word autotext entry

'Takes the template location, old and new entries as parameters

Function AutoTextReplace(strTemplate, strOldEntry, strNewEntry)
 

Dim i

Set objWord = CreateObject("Word.Application") 

Set objDoc = objWord.Documents.Open(strTemplate, False) 

Set objTxtEntry = objWord.NormalTemplate.AutoTextEntries.Add(strNewEntry, objWord.Selection.Range) 

objWord.NormalTemplate.AutoTextEntries(strNewEntry).Value = strNewEntry 

For Each i In objWord.NormalTemplate.AutoTextEntries 

   If i.Name = strOldEntry Then

	objWord.NormalTemplate.AutoTextEntries(strOldEntry).Delete

   End If

Next 

objWord.Quit 
 

End Function

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 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

14 Experts available now in Live!

Get 1:1 Help Now