none
Is this documentation correct? RRS feed

Answers

  • Hi,

    The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method. (refer to this (C# Reference))

    For example, in the link of NamedRange.Value Property, there are two samples. The first one is for a document-level customization. And you can put the code in any worksheet class like figure below:

    Then this stands for the instance of sheet1 class.

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Travis Banger Tuesday, July 22, 2014 11:44 AM
    Tuesday, July 22, 2014 10:02 AM
    Moderator

All replies

  • Please notice this page:

        This version is for an application-level add-in.

    It contains 2 snippets, one for Application-Level Add-Ins (below) and the other for Document-Level Customization.

    The code above is fine. You can just create an empty solution and paste the code.

    Monday, July 21, 2014 9:47 PM
  • The snippet for Document-Level Customization contains a this which breaks all the code:

    Monday, July 21, 2014 9:55 PM
  • After a lot of trial and error, I was able to modify the provided snippet, so it compiles:

         Deceptive Code

    The Microsoft Documentation Team could:

    (a) Add the necessary "using" statements

    or

    (b) Use fully qualified names.

    But they instead chose the blessed this.

    This is a problem repeated all over the C# code.

    Monday, July 21, 2014 11:52 PM
  • I would like to withdraw my criticism about the missing usings because the documentation always includes at the top lines like this:

    Namespace:  Microsoft.Office.Tools.Excel
    Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll

    However, the criticism about this stands.

    Tuesday, July 22, 2014 12:29 AM
  • Hi,

    The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method. (refer to this (C# Reference))

    For example, in the link of NamedRange.Value Property, there are two samples. The first one is for a document-level customization. And you can put the code in any worksheet class like figure below:

    Then this stands for the instance of sheet1 class.

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Travis Banger Tuesday, July 22, 2014 11:44 AM
    Tuesday, July 22, 2014 10:02 AM
    Moderator