Formatting output - Part 2

Discussion in 'ASP General' started by Tom Petersen, Apr 1, 2005.

  1. Tom Petersen

    Tom Petersen Guest

    Here is a little more info, sorry should have explained what my final goal
    was. I am creating a .vcs file from a form to import into Outlook. I was
    just testing the output on screen then pasting that into a file, after
    removing the extra white space, and inserting line breaks. The data is
    valid, but the formatting into the file isn't working. Was I doing the
    formatting right if I was generating a file? I need it to create the .vcs
    without any white spaces and a 'return' after each line to match the output
    at the very bottom. Here is the code again, and the bit to generate the
    file:

    strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    "VERSION:1.0" & vbCrLf & _
    "BEGIN:VEVENT" & vbCrLf & _
    "DTSTART:" & strStart & vbCrLf & _
    "DTEND:" & strStart & vbCrLf & _
    "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    "UID:" & strStart & strSubject & vbCrLf & _
    "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
    "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    "PRIORITY:3" & vbCrLf & _
    "END:VEVENT" & vbCrLf & _
    "END:VCALENDAR" & vbCrLf

    Response.ContentType = "text/x-vCalendar"
    Response.AddHeader "Content-Disposition", _
    "filename=Event" & "cal.vcs"
    Response.Write strvCalendar
    Response.End

    This gernerates an error message in Outlook stating it can't import the
    calendar file. But, again, if I paste the data into a text file with a .vcs
    extension, and delete white space and insert line breaks I can double click
    the file and it imports into Outlook fine, this is why I think I just don't
    know how to format the 'output' correctly.

    I appreciate the help!!!

    Final .vcs contents:
    BEGIN:VCALENDAR
    VERSION:1.0
    BEGIN:VEVENT
    DTSTART:20060208T180000Z
    DTEND:20060208T190000Z
    LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    UID:20051022T220000ZI-request
    DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    PRIORITY:3
    END:VEVENT
    END:VCALENDAR
     
    Tom Petersen, Apr 1, 2005
    #1
    1. Advertising

  2. Have you tried creating a .vcs file in Outlook and comparing it to what
    you're making? Here's what my vcs file looks like that I just created in
    Outlook 2002.

    BEGIN:VCALENDAR
    PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
    VERSION:1.0
    BEGIN:VEVENT
    DTSTART:20050401T160000Z
    DTEND:20050401T170000Z
    LOCATION;ENCODING=QUOTED-PRINTABLE:Location here
    UID:040000008200E00074C5B7101A82E00800000000E017AA4D9F36C5010000000000000000
    100
    000000D8C46368444C44597269263FBA4BF73
    SUMMARY;ENCODING=QUOTED-PRINTABLE:Subject here
    PRIORITY:3
    END:VEVENT
    END:VCALENDAR

    Ray at work

    "Tom Petersen" <> wrote in message
    news:...
    > Here is a little more info, sorry should have explained what my final goal
    > was. I am creating a .vcs file from a form to import into Outlook.
    >
    > This gernerates an error message in Outlook stating it can't import the
    > calendar file.


    > Final .vcs contents:
    > BEGIN:VCALENDAR
    > VERSION:1.0
    > BEGIN:VEVENT
    > DTSTART:20060208T180000Z
    > DTEND:20060208T190000Z
    > LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051022T220000ZI-request
    > DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    > PRIORITY:3
    > END:VEVENT
    > END:VCALENDAR
    >
    >
     
    Ray Costanzo [MVP], Apr 1, 2005
    #2
    1. Advertising

  3. Tom Petersen

    Tom Petersen Guest

    Ok, strange, I sent the output to a text file instead of straight to .vcs,
    and I get the source code for the page (cal.asp) instead of just the stuff I
    want:
    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title></title>

    <STYLE>
    A {text-decoration: none;}
    </STYLE>
    </head>
    <body link="#0063CE" vlink="#0063CE" alink="#0063CE">



    <div align="center">
    <center>
    <table border="0" cellpadding="4" cellspacing="0" height="1"
    style="border: 2 solid #808080">
    <tr>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/index.asp"><font color="#FFFFFF" face="Verdana"
    size="1">Home</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/forms.asp"><font color="#FFFFFF" face="Verdana"
    size="1">Forms</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/policies.asp"><font color="#FFFFFF" face="Verdana"
    size="1">Policies</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/schedule/Page.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Schedule</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/staff_directory.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Directory</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/publications/publications.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Publications</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/support/support.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Support</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/workshop/workshop.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Workshops</font></a></td>
    <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    href="http://sd-school/forms/adminmenu.asp"><font color="#FFFFFF"
    face="Verdana" size="1">Admin</font></a></td>
    </tr>
    </table>
    </center>
    </div>

    </body>

    </html>
    BEGIN:VCALENDAR
    VERSION:1.0
    BEGIN:VEVENT
    DTSTART:20051122T170000Z
    DTEND:20051122T170000Z
    LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    UID:20051122T170000ZI-request
    DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    PRIORITY:3
    END:VEVENT
    END:VCALENDAR

    So I do get what I need, but whole lot more! :)
    Here is the code that is generating this, any ideas on how to fix:

    strStart = strYear & strMonth & strDay & "T" & strHour & strMin & strSec &
    "Z"


    strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    "VERSION:1.0" & vbCrLf & _
    "BEGIN:VEVENT" & vbCrLf & _
    "DTSTART:" & strStart & vbCrLf & _
    "DTEND:" & strStart & vbCrLf & _
    "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    "UID:" & strStart & strSubject & vbCrLf & _
    "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf & _
    "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    "PRIORITY:3" & vbCrLf & _
    "END:VEVENT" & vbCrLf & _
    "END:VCALENDAR" & vbCrLf

    'Response.ContentType = "text/x-vCalendar"
    Response.ContentType = "application/octet-stream"
    Response.AddHeader "Content-Disposition", "attachment; filename=cal.txt"
    'Response.AddHeader "Content-Disposition", _
    ' "filename=Event" & "cal.txt"
    Response.Write strvCalendar
    ' Response.End

    Now, I'm not done generating the calrndar data, but what I have so far is
    valid. I'm guessing my problem lies with the last 7 lines of the code...
     
    Tom Petersen, Apr 1, 2005
    #3
  4. Tom Petersen

    Tom Petersen Guest

    Quick follow-up.

    I am doing a:
    'server.execute "../header.htm"
    at the beginning of cal.asp, it is puttin gthe contents of that file into my
    Response.Write strvCalendar variable.
    Is this normal, any way to stop it from doing that? I commented out that
    line and it works great!!! (but I still need to do it!)

    TIA


    "Tom Petersen" <> wrote in message
    news:...
    > Ok, strange, I sent the output to a text file instead of straight to .vcs,
    > and I get the source code for the page (cal.asp) instead of just the stuff

    I
    > want:
    > <html>
    >
    > <head>
    > <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    > <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    > <meta name="ProgId" content="FrontPage.Editor.Document">
    > <title></title>
    >
    > <STYLE>
    > A {text-decoration: none;}
    > </STYLE>
    > </head>
    > <body link="#0063CE" vlink="#0063CE" alink="#0063CE">
    >
    >
    >
    > <div align="center">
    > <center>
    > <table border="0" cellpadding="4" cellspacing="0" height="1"
    > style="border: 2 solid #808080">
    > <tr>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/index.asp"><font color="#FFFFFF" face="Verdana"
    > size="1">Home</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/forms.asp"><font color="#FFFFFF" face="Verdana"
    > size="1">Forms</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/policies.asp"><font color="#FFFFFF" face="Verdana"
    > size="1">Policies</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/schedule/Page.asp"><font color="#FFFFFF"
    > face="Verdana" size="1">Schedule</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/staff_directory.asp"><font color="#FFFFFF"
    > face="Verdana" size="1">Directory</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/publications/publications.asp"><font

    color="#FFFFFF"
    > face="Verdana" size="1">Publications</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/support/support.asp"><font color="#FFFFFF"
    > face="Verdana" size="1">Support</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/workshop/workshop.asp"><font color="#FFFFFF"
    > face="Verdana" size="1">Workshops</font></a></td>
    > <td height="1" bgcolor="#0063CE" valign="bottom" align="left"><a
    > href="http://sd-school/forms/adminmenu.asp"><font color="#FFFFFF"
    > face="Verdana" size="1">Admin</font></a></td>
    > </tr>
    > </table>
    > </center>
    > </div>
    >
    > </body>
    >
    > </html>
    > BEGIN:VCALENDAR
    > VERSION:1.0
    > BEGIN:VEVENT
    > DTSTART:20051122T170000Z
    > DTEND:20051122T170000Z
    > LOCATION;ENCODING=QUOTED-PRINTABLE:Library
    > UID:20051122T170000ZI-request
    > DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
    > SUMMARY;ENCODING=QUOTED-PRINTABLE:I-request
    > PRIORITY:3
    > END:VEVENT
    > END:VCALENDAR
    >
    > So I do get what I need, but whole lot more! :)
    > Here is the code that is generating this, any ideas on how to fix:
    >
    > strStart = strYear & strMonth & strDay & "T" & strHour & strMin & strSec &
    > "Z"
    >
    >
    > strvCalendar = "BEGIN:VCALENDAR" & vbCrLf & _
    > "VERSION:1.0" & vbCrLf & _
    > "BEGIN:VEVENT" & vbCrLf & _
    > "DTSTART:" & strStart & vbCrLf & _
    > "DTEND:" & strStart & vbCrLf & _
    > "LOCATION;ENCODING=QUOTED-PRINTABLE:" & strLocation & vbCrLf & _
    > "UID:" & strStart & strSubject & vbCrLf & _
    > "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" & strDescription & vbCrLf &

    _
    > "SUMMARY;ENCODING=QUOTED-PRINTABLE:" & strSubject & vbCrLf & _
    > "PRIORITY:3" & vbCrLf & _
    > "END:VEVENT" & vbCrLf & _
    > "END:VCALENDAR" & vbCrLf
    >
    > 'Response.ContentType = "text/x-vCalendar"
    > Response.ContentType = "application/octet-stream"
    > Response.AddHeader "Content-Disposition", "attachment; filename=cal.txt"
    > 'Response.AddHeader "Content-Disposition", _
    > ' "filename=Event" & "cal.txt"
    > Response.Write strvCalendar
    > ' Response.End
    >
    > Now, I'm not done generating the calrndar data, but what I have so far is
    > valid. I'm guessing my problem lies with the last 7 lines of the code...
    >
    >
    >
     
    Tom Petersen, Apr 1, 2005
    #4
  5. Why would you want header HTML in a vcs file? I don't understand.

    Ray at home

    "Tom Petersen" <> wrote in message
    news:...
    > Quick follow-up.
    >
    > I am doing a:
    > 'server.execute "../header.htm"
    > at the beginning of cal.asp, it is puttin gthe contents of that file into
    > my
    > Response.Write strvCalendar variable.
    > Is this normal, any way to stop it from doing that? I commented out that
    > line and it works great!!! (but I still need to do it!)
    >
    > TIA
    >
     
    Ray Costanzo [MVP], Apr 2, 2005
    #5
  6. Tom Petersen

    Tom Petersen Guest

    I don't want them, but somehow, they are getting inserted...


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:Os17%...
    > Why would you want header HTML in a vcs file? I don't understand.
    >
    > Ray at home
    >
    > "Tom Petersen" <> wrote in message
    > news:...
    > > Quick follow-up.
    > >
    > > I am doing a:
    > > 'server.execute "../header.htm"
    > > at the beginning of cal.asp, it is puttin gthe contents of that file

    into
    > > my
    > > Response.Write strvCalendar variable.
    > > Is this normal, any way to stop it from doing that? I commented out

    that
    > > line and it works great!!! (but I still need to do it!)
    > >
    > > TIA
    > >

    >
     
    Tom Petersen, Apr 4, 2005
    #6
  7. Tom Petersen

    Tom Petersen Guest

    Figured it out, had Response.End still commented out, seemed to do the
    trick.

    Thanks for all the help!!!


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:Os17%...
    > Why would you want header HTML in a vcs file? I don't understand.
    >
    > Ray at home
    >
    > "Tom Petersen" <> wrote in message
    > news:...
    > > Quick follow-up.
    > >
    > > I am doing a:
    > > 'server.execute "../header.htm"
    > > at the beginning of cal.asp, it is puttin gthe contents of that file

    into
    > > my
    > > Response.Write strvCalendar variable.
    > > Is this normal, any way to stop it from doing that? I commented out

    that
    > > line and it works great!!! (but I still need to do it!)
    > >
    > > TIA
    > >

    >
     
    Tom Petersen, Apr 4, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGl0Y2Fpcm5pYQ==?=

    Formatting Repeater oontrol output

    =?Utf-8?B?UGl0Y2Fpcm5pYQ==?=, Feb 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    558
    Bubba Earl JimBob Joe
    Feb 17, 2005
  2. ian
    Replies:
    0
    Views:
    494
  3. Ryan
    Replies:
    0
    Views:
    509
  4. Jack
    Replies:
    8
    Views:
    299
  5. justme
    Replies:
    1
    Views:
    123
    phaylon
    Feb 8, 2005
Loading...

Share This Page