PC Review


Reply
Thread Tools Rate Thread

Addition/Deletion to autocorrect list by vb

 
 
=?Utf-8?B?VWxyaWNoMTk0Nw==?=
Guest
Posts: n/a
 
      4th Apr 2006
hi all,
using access 2002, i would like to add - on opening a form - an entry to the
list of autocorrections and by closing the form, i would like to delete the
entry. anyone knows, whether this is possible by using vb code in the opening
/ closing procedure?

hopefully thanking in advance

ulrich1947
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFydGlu?=
Guest
Posts: n/a
 
      5th Apr 2006
Interesting problem. Access doesn't expose the AutoCorrect object (beyond
the chance to display the dialog box) so a way round is to use Word instead
because AutoCorrect is now shared throughout Office. Here's my code (make
sure M/soft Word Object Library is ticked in Tools, References in Access's VB
Editor):

Private Sub Form_Close()
Dim myWord As New Word.Application
myWord.AutoCorrect.Entries("Mratin").Delete
myWord.Quit
Set myWord = Nothing
End Sub

Private Sub Form_Open(Cancel As Integer)
Dim myWord As New Word.Application
myWord.AutoCorrect.Entries.Add Name:="Mratin", Value:="Martin"
myWord.Quit
Set myWord = Nothing
End Sub

Unfortunately the deletion part doesn't seem to work - I guess some sort of
refresh issue because if you exit Access and then reload it you find the
entry has actually been deleted.

I'd be interested to see a fix for this.


"Ulrich1947" wrote:

> hi all,
> using access 2002, i would like to add - on opening a form - an entry to the
> list of autocorrections and by closing the form, i would like to delete the
> entry. anyone knows, whether this is possible by using vb code in the opening
> / closing procedure?
>
> hopefully thanking in advance
>
> ulrich1947

 
Reply With Quote
 
=?Utf-8?B?VWxyaWNoMTk0Nw==?=
Guest
Posts: n/a
 
      13th Apr 2006
Thanks very much, your suggestion mainly helped to solve my problem. I have
put the ADD into the opening procedure of my application and the DELETE into
the closing procedure which is good enough to eliminate my actual problem
(changing the german "ß" into "ss" for sorting and autofill reasons).

However, I tried to act it all through for other needs, as I might need it
occasionally again. It seems to happen the following: Adding / Deleting an
entry by procedure two files in C:\Documents an
Parameters\Administrator\UserData\Microsoft\Office are effected, namely

MSO1031.acl, an AutoCorrect ListFile (containig the list of - german -
autocorrections) and
WORD.pip, an MicroSoft Office Settings File

After adding, MSO1031.acl contains the newly entered autocorrection Text,
the entry ist applicable
After deletion, MSO1031.acl does NOT contain the text regarded anymore
(actually as requested), but the Control within Access, which lists all the
autocorrections, still displays the entries just deleted. Furthermore, the
deleted entry ist still applicable. On the other hand, if one tries to delete
the entry by procedure again, this will lead to the error 5941.

I am not familiar with this kind of programming but obviously the list
displayed consists of a copy of the original file MSO1031.acl which is not
updated simultaneously but gets loaded/connected (probably via WORD.pip) each
time, the application ist started.

Could it be a solution to execute the ".pip" file again while the Access
Application remains open and if, how do I do that. Any idea?

I hope, I made myself clear, although its not my language.

Thanks in advance for trying.

Ulrich 1947

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
protect columns (prevent addition or deletion) qwertyjjj Microsoft Excel Programming 3 16th Aug 2006 09:15 AM
How to ALLOW ADDITION to but PREVENT DELETION from a design templa =?Utf-8?B?RXBpbm4=?= Microsoft Powerpoint 8 1st Jun 2006 07:46 PM
Search list for new addition =?Utf-8?B?TWFjIExhbmRlcnM=?= Microsoft Excel Worksheet Functions 6 25th Feb 2005 07:15 PM
Permanent deletion of unwanted addition to favorites list Leon Noel Windows XP Networking 1 13th Jun 2004 03:58 AM
Pull Down List Addition Chris B Microsoft Access Form Coding 1 5th Aug 2003 03:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:04 AM.