none
I have a question about the underscore. RRS feed

  • Question

  • I can't upload pictures because my account is not authenticated.


    It is the address of the picture.


    The black line was drawn by me,

    and the red and blue lines were drawn by the spelling check.

    I wonder that can draw blue and red lines through programming.




    • Edited by nrisnh Thursday, May 10, 2018 7:56 AM
    Tuesday, April 3, 2018 2:54 AM

Answers

  • Hi nrisnh,

    You had mentioned that,"With the black line still in place, I would like to draw red and blue lines through programming like a spell check.This line disappears when you print or save it. I want to draw this line."

    From above description, It looks like you want to intentionally display the spelling / grammar errors when you print the document.

    You will notice that, there is only one underline you can show programmatically at a time.

    Because, We are displaying the same black underline by giving wavy style and different color.

    So if you are displaying the black one you can not display a wavy underline with different color.

    Also Word object model does not provide any feature to print spelling / grammar errors with underline.

    So you can just try to show wavy colored lines.

    As a work around, You can try to set background colors of word to highlight the words which have spelling / grammar errors.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, April 4, 2018 6:48 AM
    Moderator

All replies

  • Hi,

    If "110.15.18.28" is an IP address of host computer, your description indicates root directory of the computer.
    I'm afraid you don't have permission to access root. We usually place pictures in sub/child directory, instead of root.
    Please check where you should upload to (directory you have permission to access).

    Regards,

    Ashidacchi -- http://hokusosha.com/

    • Edited by Ashidacchi Tuesday, April 3, 2018 5:47 AM
    Tuesday, April 3, 2018 5:45 AM
  • Hi nrisnh,

    I can access your picture.

    You had asked,"I wonder that can draw blue and red lines through programming"

    Do you mean you just want to draw that wavy line with code?

    If yes, then you can refer an example below.

     private void button2_Click(object sender, RibbonControlEventArgs e)
            {
                Globals.ThisDocument.Application.Selection.Font.Underline = Word.WdUnderline.wdUnderlineWavy;
                Globals.ThisDocument.Application.Selection.Font.UnderlineColor = Word.WdColor.wdColorRed;
    
            }
    
            private void button3_Click(object sender, RibbonControlEventArgs e)
            {
                Globals.ThisDocument.Application.Selection.Font.Underline = Word.WdUnderline.wdUnderlineWavy;
                Globals.ThisDocument.Application.Selection.Font.UnderlineColor = Word.WdColor.wdColorBlue;
            }

    Output:

    Reference:

    1. Font.Underline Property (Word)
    2. WdUnderline Enumeration (Word)
    3. Font.UnderlineColor Property (Word)

    At present, I assume that you just want to draw an underline in different color.

    So let me know, If you are talking about spelling check programmatically.

    I will try to provide further suggestions to solve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 4, 2018 2:12 AM
    Moderator
  • With the black line still in place, I would like to draw red and blue lines through programming like a spell check.

    This line disappears when i print or save it. I want to draw this line.


    • Edited by nrisnh Wednesday, April 4, 2018 6:34 AM
    Wednesday, April 4, 2018 6:14 AM
  • Hi nrisnh,

    You had mentioned that,"With the black line still in place, I would like to draw red and blue lines through programming like a spell check.This line disappears when you print or save it. I want to draw this line."

    From above description, It looks like you want to intentionally display the spelling / grammar errors when you print the document.

    You will notice that, there is only one underline you can show programmatically at a time.

    Because, We are displaying the same black underline by giving wavy style and different color.

    So if you are displaying the black one you can not display a wavy underline with different color.

    Also Word object model does not provide any feature to print spelling / grammar errors with underline.

    So you can just try to show wavy colored lines.

    As a work around, You can try to set background colors of word to highlight the words which have spelling / grammar errors.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, April 4, 2018 6:48 AM
    Moderator