none
Load/Use external data for label RRS feed

  • Question

  • Hi,

    Is it possible to use external data for label in vsto addin? For example: I have two label: TotalWord= and Date=. So when the addin loaded, it would show something like this

    TotalWord= 203

    Date= 4am 17 March 2016

    The value for total word and date will be retrieved from a text file.

    Is this possible to do?  Thanks.


    • Edited by azmas Thursday, March 17, 2016 8:13 AM edit question
    Thursday, March 17, 2016 5:55 AM

Answers

  • Hi, azmas

    Try the following code.

    Dim fileContents As String

    fileContents = My.Computer.FileSystem.ReadAllText("C:\Users\Administrator\Desktop\data.txt")

    Dim TestString As String = fileContents

    Dim TestArray() As String = Split(TestString)

    Label1.Label = Label1.Label + TestArray(0)

    Label2.Label = Label2.Label + TestArray(1)

    Output will look like below.

    Regards

    Deepak



    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. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    • Marked as answer by azmas Friday, March 18, 2016 8:47 AM
    Friday, March 18, 2016 4:51 AM
    Moderator

All replies

  • Hi, azmas

    Try the following code.

    Dim fileContents As String

    fileContents = My.Computer.FileSystem.ReadAllText("C:\Users\Administrator\Desktop\data.txt")

    Dim TestString As String = fileContents

    Dim TestArray() As String = Split(TestString)

    Label1.Label = Label1.Label + TestArray(0)

    Label2.Label = Label2.Label + TestArray(1)

    Output will look like below.

    Regards

    Deepak



    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. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    • Marked as answer by azmas Friday, March 18, 2016 8:47 AM
    Friday, March 18, 2016 4:51 AM
    Moderator
  • Thanks Deepak. It works..

    One more thing, is screentip and supertip applicable to label? I tried it but it doesn't show the tip when mouse over it. I just want to confirm whether it can work or not..

    Thanks..

    Friday, March 18, 2016 7:33 AM