Jump to content

Listing tags on a given note in vb.net


Juriaan

Recommended Posts

Imports System
Imports EvernoteSDK
Imports System.IO
Imports System.Collections.Generic
Imports EvernoteSDK.Advanced

Public class main
dim myResultsList As List(Of ENSessionFindNotesResult)
    ENSession.SetSharedSessionConsumerKey("KEY", "SECRET")

        If ENSession.SharedSession.IsAuthenticated = False Then
            ENSession.SharedSession.AuthenticateToEvernote()




myResultsList = ENSession.SharedSession.FindNotes(ENNoteSearch.NoteSearch("text to find"), Nothing, ENSession.SearchScope.All, ENSession.SortOrder.RecentlyUpdated, 500)

                  ' Given a NoteRef instance, download that note.
            Dim myDownloadedNote As ENNote = ENSession.SharedSession.DownloadNote(myResultsList(0).NoteRef)

            For i As Integer = 0 To myDownloadedNote.TagNames.Count - 1
                Note_tags_txt.Text = Note_tags_txt.Text + " " + myDownloadedNote.TagNames.Item(i)
            Next
end class 


On Stackoverflow I was informed to use "GetNoteTagNames" instead, but without proper example in vb.net that comment sounded a bit cryptic, since I cannot find that command.

I seem to be able to do all other operations on the notes just fine, such as getting the resources, the title, the content, the notebook name, and even searching note. It is just the tag name I cannot seem to be able to retrieve...

Could someone post a vb.net example on how to get the tags of a note given the note GUID? 
Link to comment
  • Level 5*
On 11/29/2017 at 9:22 AM, Juriaan said:

Could someone post a vb.net example on how to get the tags of a note given the note GUID?

Thanks for posting this here, in this forum.  In spite of what the above poster stated, there are a number of forum members here who have an extensive technical background, and might be able to help.  IAC, if you are able to arrive at a solution that works, there may be some members here who would like to use your code.

Of course, it is also wise to post in the Stackoverflow forum as well.

Please keep us informed if you are able to make any progress.

Link to comment
  • Level 5*
On 11/29/2017 at 10:22 AM, Juriaan said:

On Stackoverflow I was informed to use "GetNoteTagNames" instead, but without proper example in vb.net that comment sounded a bit cryptic, since I cannot find that command. I seem to be able to do all other operations on the notes just fine, such as getting the resources, the title, the content, the notebook name, and even searching note. It is just the tag name I cannot seem to be able to retrieve... Could someone post a vb.net example on how to get the tags of a note given the note GUID?

OK, so first thing, it looks like you're using the Windows SDK, but the StackOverflow person is recommending API functionality. And it accessing the tag list seems reasonable, though I'm not a VB dev. So what exactly is failing for you? Are you getting any tag names at all? An error?

How about trying something like:

For Each tag As myDownloadedNote.TagNames
     Note_tags_txt.Text = Note_tags_txt.Text + " " + tag
Next
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...