-2

I'm trying to use VB to post to the console the name of an event, the start date, and the displayname or email of the attendees for that event.

But I can't seem to get it to display.

Please help!

This is what I have tried which seems logical but doesn't work :(

Console.WriteLine(calendarEvent1.Summary & ". Start date: " & CalendarEvent1.Start.DateTime.ToString() & ". Assigned to: " & calendarEvent1.Attendees.displayName)

  • What errors do you get - and we need more code to be able to duplicate it - Have a look here [mcve] and here on how to ask great questions [ask] – David Wilson Apr 16 '16 at 22:31

1 Answers1

0

.Attendees returns a list, so to return the name of the first attendee, you would use this line instead.

Console.WriteLine(calendarEvent1.Summary & ". Start date: " & CalendarEvent1.Start.DateTime.ToString() & ". Assigned to: " & calendarEvent1.Attendees(0).DisplayName

If you want to list all the attendees, then you would need to iterate over the list in exactly the same way as you do in VB.Net lists.

David Wilson
  • 4,369
  • 3
  • 18
  • 31