This looks extraordinarily cool. I wish I had the know-how to write
applications and embed them in a document. One thing, though, when I clicked
on "Backup" after downloading the application/doc, it indicates there is some
kind of error that needs debuging. I'm going to describe it for you, in case
that is useful to you for your program. I don't expect you do to anything as
far as solving this thing on my computer; it might just be something on my
system that's causing the problem. Anyway, FYI:
Visual basic popped up with this message:
"Run time error '91': Object variable or With block variable not set.
I don't know visual basic, so I hit debug, and it showed the code with a
part-highlighted. This baffled me, so I simply closed out. And when I did,
there was a table with a bunch of my autocorrects. But there were about 200
lines that were empty, so I'm wondering if the error interrupted the process
and that's what the lines represent. Here is the part that VB editor showed
with some highlighting (the highlighted portion is indicated by
">>>>>>>>>>>>>" a few lines before End Run, and the snippet was
MyRange.Collapse:
'****** GetAutoCorrectEntries() ******
'
' Inserts each AutoCorrect entry into a Word document including the Value
and whether
' or not it is to include formatting. Name is the current name of the entry,
' Value is the text value of the entry, and RTF is a Boolean that is True if
the entry
' has "formatted text" checked. Then converts the text into a table and
adds a heading row to the table.
'
' x is used to loop through the AutoCorrect entries.
' TotalACEntries is the number of AC entries.
Private Function GetAutoCorrectEntries()
Dim x As Long
Dim TotalACEntries As Long
Dim oRow As Row, MyRange As Range, oTable As Table, TestRange As Range
TotalACEntries = Application.Autocorrect.Entries.Count
Set oTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
NumRows:=(TotalACEntries + 1), NumColumns:=3)
Set MyRange = oTable.Cell(1, 1).Range
MyRange.Collapse
MyRange.Text = "Name"
Set MyRange = MyRange.Next(wdCell)
MyRange.Collapse
MyRange.Text = "Value"
Set MyRange = MyRange.Next(wdCell)
MyRange.Collapse
MyRange.Text = "RTF"
Set MyRange = MyRange.Next(wdCell)
MyRange.Collapse
For x = 1 To TotalACEntries
MyRange.Text = Application.Autocorrect.Entries(x).Name
Set MyRange = MyRange.Next(wdCell)
MyRange.Collapse
'check for formatting and insert RTF text if necessary
If Application.Autocorrect.Entries(x).RichText = True Then
Application.Autocorrect.Entries(x).Apply Range:=MyRange
Else
MyRange.Text = Application.Autocorrect.Entries(x).Value
End If
If Len(MyRange.Cells(1).Range.Text) = 2 Then
'if the autocorrect entry was a table, the current cell will be empty
Set MyRange = MyRange.Tables(1).Range
MyRange.Collapse wdCollapseEnd
End If
Set MyRange = MyRange.Next(wdCell)
MyRange.Collapse
MyRange.Text = Application.Autocorrect.Entries(x).RichText
If x < TotalACEntries Then
Set MyRange = MyRange.Next(wdCell)End If
'update status bar
Application.StatusBar = "Adding AutoCorrect Entry: " & x & " of " &
TotalACEntries
Next x
Set MyRange = Nothing
ActiveDocument.Range(0, 0).Select
End Function
___________________________________________________________
Anyway, thanks for your information. I will still try to use this when I
transfer.