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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert WordPerfect 10 QuickCorrect to Word 2003 autocorrect

Status
Not open for further replies.

toekneel

Programmer
Aug 10, 2001
96
US
My wife works as a medical transcriptionist, and for the last five years has amassed quite a large QuickCorrect file in WordPerfect 10. She's shifting to a new company now and is needing to move over to Word (we have 2003 already available, as well as 2007). How can I convert her WordPerfect *.uwl file into a Word *.acl file?
 
There should be a WP file named wtspllen.exe that will help you create a text file of all your QuickCorrect entries. Youi can re-create AutoText form the text file.

I imagine it's still a lot of work.

Member- AAAA Association Against Acronym Abusers
 
Although any further questions should be posted in the VBA forum, the syntax to add new AutoCorrect entries is:
Code:
AutoCorrect.Entries.Add Name:="[i]wrong_spelling[/i]", Value:="[i]correct_spelling[/i]"

Once you get the text file output from WP, you can take each one and loop it into the code above. I assume that the text file will have both incorrect, and correct, spellings for each item.

For example (and I have no idea if the output text file is structured this way) if the text file has the wrong spelling first, followed by right spelling, with each item on its own paragraph line:

wrong right
wrong right
wrong right
etc

then opening the text file and running this will add them.
Code:
Dim strWrong, strRight As String
Dim oPara As Paragraph
On Error Resume Next
For Each oPara In ActiveDocument.Paragraphs
   strWrong = Split(oPara.Range.Text)(0)
   strRight = Split(oPara.Range.Text)(1)
   strRight = Left(strRight, Len(strRight) - 1)
   AutoCorrect.Entries.Add Name:=strWrong, Value:=strRight
Next
The On Error will take care of that messy ending paragraph mark in all Word docs. The second instruction to strRight takes care of the paragraph mark after the second word. It is included in the range, and I assume you would not want to keep it. Otherwise the AutoCorrect entry would force a new paragraph every time, which, ummmm, does not sound like a desired outcome.

Gerry
My paintings and sculpture
 
I have not been able to find wtspllen.exe, either on the pc or on a google search.

I can work at converting that file manually until/unless I can find that.

Thanks for all of the input here- I believe this is giving me good direction for accomplishing this task! I will post my finding after my work is completed.
 
If you have to do it manually, a good option in Word is Edit > Past Special > Text. It means it forgets its old formatting, including the stuff you'd like to keep, but probably less trouble in the long run.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
this question has been asked before

thread67-844387
 
I'm finally getting a chance to dig into this a bit more. The previous threads that I found did not answer my questions- the direction given did not work for me, as the initial Word Perfect file was not existent.

I converted the list into a text file, working with Excel to pull it off fairly quickly. There are 1924 entries that I am converting. When I ran the code in MS Word, I realized that the code was expecting one word to be converted into another word. In this case, one word might be an abbreviation which would then be converted into a lengthy string of words. This caused the code to fail. I figured that the autocorrect in Excel is the exact same file used by Word, and now I'm attempting to simply look at the value in the first row, cell A1 and correct it to the value in cell B1, etc. all the way through row 1924.

It's been a long time since I've done anything in VBA- I moved into VB.NET since that time. My code here is a bit rusty. I'm going to check other tek-tips postings in Excel for help, but any other input is appreciated!
 
Just to update progress here... this is my code as it stands:

Public Sub sbAddAutoCorrect()

Dim strCode, strConvert As String
Dim intA As Integer

For intA = 0 To 4
intA = intA + 1
strCode = Cells(intA, "A").Value
strConvert = Cells(intA, "B").Value
'AutoCorrect.AddReplacement strConvert, strCode
AutoCorrect.Entries.Add Name:=strCode, Value:=strConvert
Next

End Sub

When I attempt to run it, I get "object required" notice for either variation that I'm attempting for AutoCorrect. I've checked the variables, and they are pulling my data properly. I just need to get the code for that last line set up properly.
 
I've refined this code to this:

Public Sub sbAddAutoCorrect()

Dim strCode, strConvert As String
Dim intA As Integer

For intA = 1 To 1924
strCode = Cells(intA, "A").Value
strConvert = Cells(intA, "B").Value
With Application.AutoCorrect
.AddReplacement strConvert, strCode
End With
Next

End Sub

It returns no error messages, yet it does not update the AutoCorrect file.
 
Here's the code that finally worked- loaded all 1924 entries in a nanosecond!

(intA represents the row number, and I'm using column A for the code value and column B for the converted value)

Public Sub sbAddAutoCorrect()

Dim strCode, strConvert As String
Dim intA As Integer

For intA = 1 To 1924
strCode = Cells(intA, "A").Value
strConvert = Cells(intA, "B").Value
Application.AutoCorrect.AddReplacement What:=strCode, Replacement:=strConvert
Next

End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top