Prev: Creating a newsgroup
Next: Count how many specific character there is in a string(readed from txt file)
From: Diamonds_Mine on 1 Jun 2010 17:36 Using Windows XP SP3 and Office 2003 SP3 w/multi-language packs installed. I have added Arabic (Saudi Arabia) as an input language and would like to use a script to set the "Numeral" option from "Arabic" to "Context" in Word (Tools | Options, Complex Scripts). I am using the script below based on a similar script found on the TechNet website. The script runs without errors, but the setting is not changed. Any help would be appreciated. Thanks in advance On Error Resume Next Set objWord = CreateObject("Word.Application") Set objOptions = objWord.Options() objOptions.ArabicNumeral = wdNumeralContext objWord.Quit
From: Tom Lavedas on 2 Jun 2010 08:21 On Jun 1, 5:36 pm, Diamonds_Mine <DiamondsM...(a)discussions.microsoft.com> wrote: > Using Windows XP SP3 and Office 2003 SP3 w/multi-language packs installed.. I > have added Arabic (Saudi Arabia) as an input language and would like to use a > script to set the "Numeral" option from "Arabic" to "Context" in Word (Tools > | Options, Complex Scripts). I am using the script below based on a similar > script found on the TechNet website. The script runs without errors, but the > setting is not changed. Any help would be appreciated. Thanks in advance > > On Error Resume Next > > Set objWord = CreateObject("Word.Application") > Set objOptions = objWord.Options() > objOptions.ArabicNumeral = wdNumeralContext > > objWord.Quit You need to explicitly define the constant wdNumeralContext in a script that is external to Word, that is, one that is not running as a Word (VBA) macro ... const wdNumeralContext = 2 The constants are not defined by the Application object. I would also comment that it is counterproductive to use an "On Error Resume Next" statement that blankets the script, especially without any error checking. It just hides the errors that may exist, without making the script any more robust. It also makes such errors nearly impossible to troubleshoot. (I realize MS sample scripts generally do this, but that doesn't make it any better.) _____________________ Tom Lavedas
From: Diamonds_Mine on 3 Jun 2010 14:40
Thank you. Works perfectly now. "Tom Lavedas" wrote: > On Jun 1, 5:36 pm, Diamonds_Mine > <DiamondsM...(a)discussions.microsoft.com> wrote: > > Using Windows XP SP3 and Office 2003 SP3 w/multi-language packs installed.. I > > have added Arabic (Saudi Arabia) as an input language and would like to use a > > script to set the "Numeral" option from "Arabic" to "Context" in Word (Tools > > | Options, Complex Scripts). I am using the script below based on a similar > > script found on the TechNet website. The script runs without errors, but the > > setting is not changed. Any help would be appreciated. Thanks in advance > > > > On Error Resume Next > > > > Set objWord = CreateObject("Word.Application") > > Set objOptions = objWord.Options() > > objOptions.ArabicNumeral = wdNumeralContext > > > > objWord.Quit > > You need to explicitly define the constant wdNumeralContext in a > script that is external to Word, that is, one that is not running as a > Word (VBA) macro ... > > const wdNumeralContext = 2 > > The constants are not defined by the Application object. > > I would also comment that it is counterproductive to use an "On Error > Resume Next" statement that blankets the script, especially without > any error checking. It just hides the errors that may exist, without > making the script any more robust. It also makes such errors nearly > impossible to troubleshoot. (I realize MS sample scripts generally do > this, but that doesn't make it any better.) > _____________________ > Tom Lavedas > . > |