• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 778
  • Last Modified:

VB.net VCalendar - multiple lines in Calendar description

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
Murray Brown
Asked:
Murray Brown
  • 4
  • 4
1 Solution
 
CodeCruiserCommented:
Try using <br /> intead of vbcrlf
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
please could you show me how to do that
I want to build my description in a VB string variable eg strDescription
0
 
CodeCruiserCommented:
strDescription = "Line1 <br /> Line2 <br/> Line3..."
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi I built my string like that and still got
School - St Stithian’s JP <br /> Applicable to - STAFF, PARENT <br /> House etc
0
 
CodeCruiserCommented:
Where are you viewing it? Outlook? Have you enabled HTML emails in Outlook?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
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
 
CodeCruiserCommented:
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now