[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.net VCalendar - multiple lines in Calendar description

Posted on 2011-05-10
8
Medium Priority
?
765 Views
Last Modified: 2012-05-11
Hi. I am using the following line
sbICSFile.AppendLine("DESCRIPTION:" + txtEventDescription.Text)
for the description in a VCalendar (Shown in code below)
My problem is that I want to have multiple lines in the Description and vbcrlf doesn't seem to work
How can I update this line to have multiple lines in the event description?
' US/Pacific
    sbICSFile.AppendLine("BEGIN:VTIMEZONE")
    sbICSFile.AppendLine("TZID:US/Pacific")
    sbICSFile.AppendLine("BEGIN:STANDARD")
    sbICSFile.AppendLine("DTSTART:20071104T020000")
    sbICSFile.AppendLine("RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11")
    sbICSFile.AppendLine("TZOFFSETFROM:-0700")
    sbICSFile.AppendLine("TZOFFSETTO:-0800")
    sbICSFile.AppendLine("TZNAME:PST")
    sbICSFile.AppendLine("END:STANDARD")
    sbICSFile.AppendLine("BEGIN:DAYLIGHT")
    sbICSFile.AppendLine("DTSTART:20070311T020000")
    sbICSFile.AppendLine("RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3")
    sbICSFile.AppendLine("TZOFFSETFROM:-0800")
    sbICSFile.AppendLine("TZOFFSETTO:-0700")
    sbICSFile.AppendLine("TZNAME:PDT")
    sbICSFile.AppendLine("END:DAYLIGHT")
    sbICSFile.AppendLine("END:VTIMEZONE")

    ' Define the event
    sbICSFile.Append("DTSTART;TZID=" + ddlStartTZ.Text + ":")
    sbICSFile.Append(calStartDate.SelectedDate.Year.ToString())
    sbICSFile.Append( _
        FormatDateTimeValue(calStartDate.SelectedDate.Month))
    sbICSFile.Append( _
        FormatDateTimeValue(calStartDate.SelectedDate.Day) + "T")
    sbICSFile.AppendLine(ddlStartTime.SelectedValue)

    sbICSFile.Append("DTEND;TZID=" + ddlEndTZ.Text + ":")
    sbICSFile.Append(calEndDate.SelectedDate.Year)
    sbICSFile.Append( _
        FormatDateTimeValue(calEndDate.SelectedDate.Month))
    sbICSFile.Append( _
        FormatDateTimeValue(calEndDate.SelectedDate.Day) + "T")
    sbICSFile.AppendLine(ddlEndTime.SelectedValue)

    sbICSFile.AppendLine("SUMMARY:" + txtEventSummary.Text)
    sbICSFile.AppendLine("DESCRIPTION:" + txtEventDescription.Text)
    sbICSFile.AppendLine("UID:1")
    sbICSFile.AppendLine("SEQUENCE:0")

    sbICSFile.Append("DTSTAMP:" + dtNow.Year.ToString())
    sbICSFile.Append(FormatDateTimeValue(dtNow.Month))
    sbICSFile.Append(FormatDateTimeValue(dtNow.Day) + "T")
    sbICSFile.Append(FormatDateTimeValue(dtNow.Hour))
    sbICSFile.AppendLine(FormatDateTimeValue(dtNow.Minute) + "00")

    sbICSFile.AppendLine("END:VEVENT")
    sbICSFile.AppendLine("END:VCALENDAR")

    Response.ContentType = "text/calendar"
    Response.AddHeader("content-disposition", _
        "attachment; filename=CalendarEvent1.ics")
    Response.Write(sbICSFile)
    Response.End()

Open in new window

0
Comment
Question by:Murray Brown
  • 4
  • 4
8 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35731610
Try using <br /> intead of vbcrlf
0
 

Author Comment

by:Murray Brown
ID: 35731905
please could you show me how to do that
I want to build my description in a VB string variable eg strDescription
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35731932
strDescription = "Line1 <br /> Line2 <br/> Line3..."
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 

Author Comment

by:Murray Brown
ID: 35735064
Hi I built my string like that and still got
School - St Stithian’s JP <br /> Applicable to - STAFF, PARENT <br /> House etc
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 35736082
Where are you viewing it? Outlook? Have you enabled HTML emails in Outlook?
0
 

Author Comment

by:Murray Brown
ID: 35736108
Hi
Yes it goes into Outlook.
I need to send the .ics file to hundreds of people so I need it to come up with
separate lines in the description on their machines
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 35736135
0
 

Author Closing Comment

by:Murray Brown
ID: 35736933
Thanks
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question