A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2007 does not display ACCEPT|DECLINE buttons with an ICAL invitation



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 29th 09, 11:20 AM posted to microsoft.public.outlook.program_vba
francesco
external usenet poster
 
Posts: 2
Default Outlook 2007 does not display ACCEPT|DECLINE buttons with an ICAL invitation

Dear All,

I developed an application to send meeting invitation using iCAL 2.0
protocol. The code is sent both in a proper body-section with
ContentType("text/calendar") and as attachment (.ics).

Once the receiver opens the email, the emai client evaluates such a
body-section and displays all the data properly as a normal meeting request
(showing the ACCEPT | TENTATIVE | DECLINE buttons).
This works with: Gmail, Thunderbird and Outlook 2003.
In Outlook 2007 the email is received as normal message. Only opening the
..ics attachment it then displays (in the attachment window) the buttons.

How should I edit my code in order to be able to display directly the
buttons in OE2007?

Here the code for creating the iCAL invitation:

string Content = "";
Content += "BEGIN:VCALENDAR\r\n";
Content += "PRODID:Microsoft CDO for Microsoft Exchange\r\n";
Content += "VERSION:2.0\r\n";
Content += "METHOD:REQUEST\r\n";
Content += "BEGIN:VEVENT\r\n";
Content +=
"ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:" +
person.eMail + "\r\n";
Content += "ORGANIZER:MAILTO:" + Organizer.eMail + "\r\n";
Content += "DTSTART:" + this.GetDateTime(this.Start) + "\r\n";
//LOCAL TIME
Content += "DTEND:" + this.GetDateTime(this.End) + "\r\n";
//LOCAL TIME
Content += "LOCATION:" + this.Location + "\r\n";
Content += "DTSTAMP:" + this.GetDateTime(DateTime.Now) + "\r\n";
Content += "UID:" + this.UID + "\r\n";
Content += "CREATED: " + this.GetDateTime(DateTime.Now) +
"\r\n";
Content += "SEQUENCE:0\r\n"; //Keeps track if the iCAL is
modified
Content += "LAST-MODIFIED: " + this.GetDateTime(DateTime.Now) +
"\r\n";
Content += "PRIORITY:5\r\n";
Content += "X-MICROSOFT-CDO-TZID:11\r\n";
Content += "STATUS:CONFIRMED\r\n";
Content += "TRANSP:OPAQUE\r\n";
Content += "DESCRIPTION:" + this.Description.Replace("\r\n",
"\\n") + "\r\n";
Content += "SUMMARY:" + this.Summary + "\r\n";
Content += "X-MICROSOFT-CDO-BUSYSTATUS:BUSY";
Content += "X-MICROSOFT-CDO-IMPORTANCE:1";
Content += "X-MICROSOFT-DISALLOW-COUNTER:TRUE";
Content += "X-MS-OLK-ALLOWEXTERNCHECK:TRUE";
Content += "X-MS-OLK-AUTOFILLLOCATION:TRUE";
Content += "X-MS-OLK-CONFTYPE:0";
Content += "X-MS-OLK-FORCEINSPECTOROPEN:TRUE\r\n";
Content += "BEGIN:VALARM\r\n";
Content += "ACTIONISPLAY\r\n";
Content += "DESCRIPTION:REMINDER\r\n";
Content += "TRIGGER:-PT15M\r\n";
Content += "END:VALARM\r\n";
Content += "END:VEVENT\r\n";
Content += "END:VCALENDAR\r\n";


And here the main part of the class sending the email:

MailMessage message = new MailMessage();
string tempFilePath = "";
string Body = this.CreateBody(ToEMail);
string Subject = this.CreateSubject(ToEMail);

message.Sender = new MailAddress(this.FromEMail, "");
message.From = new MailAddress(this.ReplyEMail, this.FromName);
message.To.Add(new MailAddress(ToEMail));
message.Body = Body;
message.Subject = this.CreateSubject(ToEMail);
message.IsBodyHtml = true;

if (this._Calendar != null)
{
this.Calendar.Description = Body
string attachmentCode = this.Calendar.GetICalendarText();

/*Setting content type */
ContentType calendarType = new ContentType("text/calendar");
calendarType.Parameters.Add("method", "REQUEST");
calendarType.CharSet = "utf-8";

int randNum = new Random().Next(100);
string meetingFileName = "meetingInvitation"+randNum+".ics";
tempFilePath =
HttpContext.Current.Server.MapPath(HttpContext.Cur rent.Request.ApplicationPath
+ "/Temp/" + meetingFileName);

if (!string.IsNullOrEmpty(attachmentCode))
{
StreamWriter tw = new StreamWriter(tempFilePath);
tw.WriteLine(attachmentCode);
tw.Dispose();
tw.Close();

if (File.Exists(tempFilePath))
{
/*Creating the attachment*/
Attachment item = new Attachment(tempFilePath,
MediaTypeNames.Application.Octet);
item.TransferEncoding = TransferEncoding.SevenBit;
calendarType.Parameters.Add("name",
""+meetingFileName+"");
ContentDisposition disp = item.ContentDisposition;
disp.CreationDate =
System.IO.File.GetCreationTime(tempFilePath);
disp.ModificationDate =
System.IO.File.GetLastWriteTime(tempFilePath);
disp.DispositionType =
DispositionTypeNames.Attachment;

message.Attachments.Add(item);
}
}

/*Creating the alternative view for the meeting invitation*/
AlternateView calendarView =
AlternateView.CreateAlternateViewFromString(attach mentCode, calendarType);
message.AlternateViews.Add(calendarView);
}

smtp.Send(message);


Thanks in advance for any suggestion.

Regards,
Francesco

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Calendar accept/ decline MrsRM Outlook - Calandaring 2 December 10th 08 10:04 PM
Accept/Decline Buttons Missing on Some Meetings Jon[_3_] Outlook - Calandaring 0 February 15th 08 04:36 PM
HTML buttons in Outlook 2007 do not display, but they did in 2003 zukowskig Outlook - General Queries 1 October 31st 07 05:45 PM
Meeting Requests - No Accept Decline or Tenative Buttons OL2002 Nick Outlook - Calandaring 4 August 3rd 06 01:17 AM
Invitations not displaying accept/decline buttons Swordsaint Outlook - Calandaring 1 April 19th 06 06:27 PM


All times are GMT +1. The time now is 02:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.