Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Word Autocorrect Entries 1

Status
Not open for further replies.

GP

IS-IT--Management
Jan 14, 2002
61
GB
I need to extract all the Autocorrect entries to a file. How do i do it? I have found a succesful script for autotext entries:

Sub ExtractAutoText()
'
' ExtractAutoText Macro
' Macro created 1/14/2004 by
'
Dim Entry As AutoTextEntry

Documents.Add

For Each Entry In NormalTemplate.AutoTextEntries

' Turn bold formatting on and insert the AutoText name
Selection.Font.Bold = True
Selection.TypeText Text:=Entry.Name

' Turn bold formatting off and insert AutoText entry
Selection.Font.Bold = False
Selection.TypeParagraph
Entry.Insert Where:=Selection.Range, RichText:=True
Selection.Range.Select
Selection.TypeParagraph

' Insert a blank line between entries
Selection.TypeParagraph
Next

End Sub
 
Hi GP,

Based on your code above ..

Code:
Sub Extract
Code:
AutoCorrect
Code:
()
'
' ExtractAutoText Macro
' Macro created 1/14/2004 by
'
Dim Entry As
Code:
AutoCorrect
Code:
Entry

Documents.Add

For Each Entry In
Code:
AutoCorrect.
Code:
Entries
Code:
' Turn bold formatting on and insert the
Code:
AutoCorrect
Code:
 name
Code:
   Selection.Font.Bold = True
   Selection.TypeText Text:=Entry.Name
Code:
' Turn bold formatting off and insert
Code:
AutoCorrect
Code:
 entry
Code:
   Selection.Font.Bold = False
   Selection.TypeParagraph
Code:
Selection.TypeText Text:=Entry.Value
Code:
Code:
' Entry.Insert Where:=Selection.Range, RichText:=True
Code:
Code:
' Remove this line
Code:
   Selection.Range.Select
   Selection.TypeParagraph

   ' Insert a blank line between entries
   Selection.TypeParagraph
Next

End Sub

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top