Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBScript - Amend Word Autocomplete list

Posted on 2008-10-13
1
Medium Priority
?
715 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
[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
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

618 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