Solved

VBScript - Amend Word Autocomplete list

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

862 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

23 Experts available now in Live!

Get 1:1 Help Now