Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    LanguageId/Noproofing (Word 2000+)

    I need help understanding/dissociating the two properties of a Word Style, specifically "NoProofing" and "LanguageID ".
    The VBA help tells me:
    NoProofing Property: Style object: True if the spelling and grammar checker ignores text formatted with this style.
    LanguageID Property: Returns or sets the language for the specified object. Can be one of the following WdLanguageID constants: ... wdNoProofing ...

    The (screenshot attached) Format, Style, Modify, Format, Language dialog offers me
    (a) a choice a language and
    ( a boolean switch to suppress/activate spell-checking.

    The macro run before and after setting "Do Not Check" on
    <pre>Sub test()
    Debug.Print Selection.Paragraphs(1).Style.LanguageID
    Debug.Print Selection.Paragraphs(1).Style.NoProofing
    End Sub</pre>

    shows me
    <pre> 1033 , 0 and 1033 ,-1 respectively.</pre>

    That is, "US English" reads as 1033, and is unaffected by the CheckSpelling checkbox.
    The Long values are not additive (as in e.g. the MsgBox constants and results)
    And "Do Not Check" yields 0=false and -1=True=Checked ON

    My confusion stems from being able to specify wdNoProofing as a language id,
    but setting the checkbox does not affect the value for the language id.

    That is, in my example above, the style.LanguageId remained at 1033 regardless of the setting.
    There is, as far as I can see, no "NoProofing" language in the little dialog box.
    It seems strange that VBA allows Noproofing as a language, but the dialog box does not.
    Attached Images Attached Images
    • File Type: jpg 7.JPG (32.2 KB, 0 views)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: LanguageId/Noproofing (Word 2000+)

    wdNoProofing is not a "real" language setting. It does not actually change the LanguageID of the range or style it is applied to - the LanguageID remains the same as it was before. Instead, the NoProofing property gets set to True.

    In other words, the effect of setting the LanguageID of a range or style to wdNoProofing is exactly the same as that of setting the NoProofing property to True.

    I suppose that wdNoProofing was supplied to provide the programmer with an alternative way of suppressing spell checking - depending on the context one or the other method might be more convenient.
    There was no need to offer an equivalent of wdNoProofing in the interface since the check box "Do not check spelling or grammar" already provides its functionality.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: LanguageId/Noproofing (Word 2000+)

    >I suppose that wdNoProofing was supplied to provide the programmer with an alternative way
    [grudgingly]OK[/grudgingly] <span style="background-color: #FFFF00; color: #FFFF00; font-weight: bold"> <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23> </span hide>

    Thanks Hans.

    The enhanced sample code demonstrates that the NoProofing operates independently from the LanguageID.

    <pre>Sub test()
    Debug.Print ""
    Debug.Print Selection.Paragraphs(1).Style.LanguageID
    Debug.Print Selection.Paragraphs(1).Style.NoProofing
    End Sub
    Sub test2()
    Selection.Paragraphs(1).Style.LanguageID = wdEnglishUS
    Call test
    Selection.Paragraphs(1).Style.LanguageID = wdNoProofing
    Call test
    Selection.Paragraphs(1).Style.LanguageID = wdEnglishUS
    Selection.Paragraphs(1).Style.LanguageID = wdNoProofing
    Call test
    End Sub</pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •