Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Error msg - you must load or assign this property before you can read its value.

$
0
0

Hi Team,

I am getting this error   "you must load or assign this property before you can read its value", when I am trying to assign the name  like below.

                      meeting.Organizer.Name = "Test";

Service Account ID is created as EXCHANGEEMAIL. As of now i am receving the MeetingInvite with From as "EXCHANGEEMAIL". I want to show From with different name instead of EXCHANGEEMAIL say I want to show the name as Test

Below is my code and please help me with inputs..

                                                                    

 private void SendMeetingInvite(string to, string subject, string meetinglocation )
        {
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);                  
            NetworkCredential myCred = new NetworkCredential(ConfigurationManager.AppSettings["ServiceAccount"], ConfigurationManager.AppSettings["ServicePassword"], ConfigurationManager.AppSettings["Domain"]);

            service.Credentials = myCred;
            service.TraceEnabled = true;
            service.TraceFlags = TraceFlags.All;
            service.AutodiscoverUrl(ConfigurationManager.AppSettings["ExchangeAddress"], RedirectionUrlValidationCallback);
            Appointment meeting = new Appointment(service);

            // Set the properties on the meeting object to create the meeting.
            meeting.Subject = subject;
            meeting.Body = "This is the email I've sent by using the EWS Managed API!";
            meeting.Start = DateTime.Now.AddMinutes(15);
            meeting.End = meeting.Start.AddHours(1);
            meeting.Location = meetinglocation;
meeting.Organizer.Name = "test";



            // attendees for meeting/required participants          
            if (!string.IsNullOrEmpty(to))
            {
                if (to.Contains(";"))
                {
                    string[] MailTo = Regex.Split(to, ";");
                    foreach (string To in MailTo)
                    {
                        if (!string.IsNullOrEmpty(To))
                        {
                           meeting.RequiredAttendees.Add(To);
                        }
                    }
                }
                else
                {
                    meeting.RequiredAttendees.Add(to);
                }
            }
            meeting.ReminderMinutesBeforeStart = 5;

            // Save the meeting to the Calendar folder and send the meeting request.
            meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy);
            meetingId = meeting.Id.ToString();

            // Verify that the meeting was created.
            Item item = Item.Bind(service, meeting.Id, new PropertySet(ItemSchema.Subject));

            label1.Text = "Meeting Invitation is sent successfully";

}

Thanks

Vamshi


Vamshi Janagama


Viewing all articles
Browse latest Browse all 7132

Trending Articles