I have a custom dictionary that works as it should until I sort it. Then on the first run it will get overwritten with a new blank (apart from my name) file. Any ideas on this?
Adam Schwanz
@Reply 2 years ago
Can you elaborate more? I don't understand the question or whats happening, pictures might help
Hi Mick. Like Adam said, this is nowhere near enough information for us to be able to help you. You don't even tell us what software you're working with. Is it Access, Excel, Word, or something else?
Mick WebbOP
@Reply
2 years ago
Thank you for your interest in this which, I am glad to say, I have resolved.
This is a MS Office custom dictionary which I am using in MS Access ' although it is seen and recognised in all Office apps, working as it should with any of the spell checking dialogs.
I am actually using it with a custom Spell Checker form, which exposes the MS Word spelling objects and works with them ' just as it should.
New words are added to the dictionary via FSO which appends them to the column within the file, obviously in the order that they are created. My problem was that if I programmatically sorted the dictionary, the first time that the CheckSpelling method was called the file got overwritten with a new version ' this containing , as the Office user, just my names.
To sort the dictionary file, using FSO I read the words into an ADO recordset, sort it and then write back from the recordset into the file. As I could manually sort the file in Notepad ++ which did not create the overwrite issue, I deduced that my problem lay here.
My first pass had concatenated the words from the recordset into a string with a vbCrLf between and then wrote the whole string to the file ' no success.
I then wrote each word separately into the file ' no success.
I tried deleting the file and recreating it before I wrote to it ' no success.
I tried writing a zero length sting to the file to clear it and then appending the words' no success.
Finally I returned to my first pass but used a vbLf only ' SUCCESS.
It all now works as it should.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.