Solved

VBScript - Amend Word Autocomplete list

Posted on 2008-10-13
1
697 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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 …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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