Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading notes using VBA #7

Open
swbuehler opened this issue May 13, 2015 · 2 comments
Open

Uploading notes using VBA #7

swbuehler opened this issue May 13, 2015 · 2 comments

Comments

@swbuehler
Copy link

No description provided.

@swbuehler
Copy link
Author

How do I call the upload function from VBA? All your documentation uses something OTHER than Visual Basic.

Sub MailtoEvernote()
    Dim en As New ENSessionForCOM
    Call en.SetSharedSessionDeveloperToken(devtoken, url)
    If en.SharedSession.IsAuthenticated = False Then
        Call en.SharedSession.AuthenticateToEvernote
    End If
    Dim enNote As New enNote, enNoteContent As New ENNoteContentForCOM
    enNote.Title = "This is a test note"
    enNote.Content = enNoteContent.NoteContentWithSanitizedHTML("<b>This</b> is a <i>test</i> Note.")
    Call en.SharedSession.UploadNote(enNote, "") ' <--This produces error.

    Set en = Nothing
End Sub

@BonzoFestoon
Copy link

BonzoFestoon commented Sep 29, 2017

I am having the same problem with this code as well:

Public Sub CreateNote(mailItem As Outlook.mailItem, url As String)
     
    If mailItem Is Nothing Then
        Exit Sub
    End If
      
    Dim evernoteSession As New ENSessionAdvancedForCOM
    Call evernoteSession.SetSharedSessionConsumerKey(Key, Secret, Host)
        
    If evernoteSession.SharedSession.IsAuthenticated = False Then
        evernoteSession.SharedSession.AuthenticateToEvernote
    End If

    Dim note As New ENNote
    note.title = mailItem.Subject
        
    Dim noteContent As New ENNoteContentForCOM
    note.content = noteContent.NoteContentWithSanitizedHTML(mailItem.HTMLBody)
    
    Call evernoteSession.SharedSession.UploadNote(note, Nothing) <-- Bang
      
End Sub

The error is 80131500 Evernote.EDAM.EDAMNotFoundException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants