Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
[RESOLVED] VBScript to update Outlook custom.dic?
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- [RESOLVED] VBScript to update Outlook custom.dic?
[RESOLVED] VBScript to update Outlook custom.dic?
06-03-2008 11:49 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi all
We have been asked to update the Outlook dictionary with a few additions on 1500+ users' machines. I know the users could easily add the addition manually themselves when prompted but this is not an option.
We need to run a script of some kind to automatically update the C:\Documents and Settings\%username%\Application Data\Microsoft\Proof\Custom.dic on all 1500+ machines. We cannot replace the existing custom.dic because the users will lose their existing entries.
Any ideas please?
We have been asked to update the Outlook dictionary with a few additions on 1500+ users' machines. I know the users could easily add the addition manually themselves when prompted but this is not an option.
We need to run a script of some kind to automatically update the C:\Documents and Settings\%username%\Application Data\Microsoft\Proof\Custom.dic on all 1500+ machines. We cannot replace the existing custom.dic because the users will lose their existing entries.
Any ideas please?
4 REPLIES 4
Re: Script updates to Outlook custom.dic?
06-03-2008 6:07 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I found a VBScript to add a custom dictionary to Word:-
Set objWord = CreateObject _
("Word.Application")
Set colDictionaries = _
objWord.CustomDictionaries
colDictionaries.Add "pm.dic"
objWord.Quit
This additional pm.dic works well in Word 2003 but it doesn't work for Outlook 2003 because Outlook only uses the default custom.dic. We don't want to make Word the default email editor, so how can we add the additional entries to the custom.dic so that it works in Outlook 2003 as well please? We may need a VBScript to open the custom.dic and append the additional entries but I'm no VB wiz?
TIA
Scott
Set objWord = CreateObject _
("Word.Application")
Set colDictionaries = _
objWord.CustomDictionaries
colDictionaries.Add "pm.dic"
objWord.Quit
This additional pm.dic works well in Word 2003 but it doesn't work for Outlook 2003 because Outlook only uses the default custom.dic. We don't want to make Word the default email editor, so how can we add the additional entries to the custom.dic so that it works in Outlook 2003 as well please? We may need a VBScript to open the custom.dic and append the additional entries but I'm no VB wiz?
TIA
Scott
Re: Update Outlook custom.dic?
07-03-2008 2:16 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The following VBscript allows me to create a new text file and add the word "DDI" into it:-
--------------
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("c:\misc\testfile.txt", True)
' Write a line with a newline character.
tf.WriteLine("DDI")
tf.Close
--------------
This is not quite what I need. I need to add "DDI" and other words to the existing custom.dic file in each user's profile.
Any ideas please?
Thanks
Scott
--------------
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("c:\misc\testfile.txt", True)
' Write a line with a newline character.
tf.WriteLine("DDI")
tf.Close
--------------
This is not quite what I need. I need to add "DDI" and other words to the existing custom.dic file in each user's profile.
Any ideas please?
Thanks
Scott
Re: [RESOLVED] VBScript to update Outlook custom.dic?
07-03-2008 5:19 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi all
I found a VBscript and tweaked it to our specific requirements:-
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.5 - August 2005
' ---------------------------------------------------------------'
Option Explicit
Dim objFSO, objFolder, objShell, objTextFile, objFile
Dim strDirectory, strFile, strText1, strText2, strText3
Dim objNetwork, strUser
' Obtain currently logged on username (equivalent to %username%)
Set objNetwork = CreateObject("Wscript.Network")
strUser = objNetwork.UserName
strDirectory = "C:\Documents and Settings\" & strUser & "\Application Data\Microsoft\Proof"
strFile = "\custom.dic"
strText1 = "Test1"
strText2 = "Test2"
strText3 = "Test3"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Check that the strDirectory folder exists
If objFSO.FolderExists(strDirectory) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFolder = objFSO.CreateFolder(strDirectory)
' WScript.Echo "Just created " & strDirectory
End If
If objFSO.FileExists(strDirectory & strFile) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFile = objFSO.CreateTextFile(strDirectory & strFile)
' Wscript.Echo "Just created " & strDirectory & strFile
End If
set objFile = nothing
set objFolder = nothing
' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
Const ForAppending = 8
Set objTextFile = objFSO.OpenTextFile _
(strDirectory & strFile, ForAppending, True)
' Writes all strText values every time you run this VBScript
objTextFile.WriteLine(strText1)
objTextFile.WriteLine(strText2)
objTextFile.WriteLine(strText3)
objTextFile.Close
' Bonus or cosmetic section to launch explorer to check file
If err.number = vbEmpty then
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" &" " & strDirectory & "\" )
Else WScript.echo "VBScript Error: " & err.number
End If
WScript.Quit
' End of VBScript to write to a file with error-correcting Code
Hope this helps others!
Scott
I found a VBscript and tweaked it to our specific requirements:-
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.5 - August 2005
' ---------------------------------------------------------------'
Option Explicit
Dim objFSO, objFolder, objShell, objTextFile, objFile
Dim strDirectory, strFile, strText1, strText2, strText3
Dim objNetwork, strUser
' Obtain currently logged on username (equivalent to %username%)
Set objNetwork = CreateObject("Wscript.Network")
strUser = objNetwork.UserName
strDirectory = "C:\Documents and Settings\" & strUser & "\Application Data\Microsoft\Proof"
strFile = "\custom.dic"
strText1 = "Test1"
strText2 = "Test2"
strText3 = "Test3"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Check that the strDirectory folder exists
If objFSO.FolderExists(strDirectory) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFolder = objFSO.CreateFolder(strDirectory)
' WScript.Echo "Just created " & strDirectory
End If
If objFSO.FileExists(strDirectory & strFile) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFile = objFSO.CreateTextFile(strDirectory & strFile)
' Wscript.Echo "Just created " & strDirectory & strFile
End If
set objFile = nothing
set objFolder = nothing
' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
Const ForAppending = 8
Set objTextFile = objFSO.OpenTextFile _
(strDirectory & strFile, ForAppending, True)
' Writes all strText values every time you run this VBScript
objTextFile.WriteLine(strText1)
objTextFile.WriteLine(strText2)
objTextFile.WriteLine(strText3)
objTextFile.Close
' Bonus or cosmetic section to launch explorer to check file
If err.number = vbEmpty then
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" &" " & strDirectory & "\" )
Else WScript.echo "VBScript Error: " & err.number
End If
WScript.Quit
' End of VBScript to write to a file with error-correcting Code
Hope this helps others!
Scott
Re: [RESOLVED] VBScript to update Outlook custom.dic?
07-03-2008 5:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Nothing like doing your own donkey work
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- [RESOLVED] VBScript to update Outlook custom.dic?