469,927 Members | 1,890 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Formatting output - Part 2

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
Jul 22 '05 #1
6 1565
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:040000008200E00074C5B7101A82E00800000000E017AA 4D9F36C5010000000000000000
100
000000D8C46368444C44597269263FBA4BF73
SUMMARY;ENCODING=QUOTED-PRINTABLE:Subject here
PRIORITY:3
END:VEVENT
END:VCALENDAR

Ray at work

"Tom Petersen" <pe****@sdsd.sdbor.edu> wrote in message
news:ep**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #2
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...

Jul 22 '05 #3
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" <pe****@sdsd.sdbor.edu> wrote in message
news:u2**************@TK2MSFTNGP15.phx.gbl...
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...

Jul 22 '05 #4
Why would you want header HTML in a vcs file? I don't understand.

Ray at home

"Tom Petersen" <pe****@sdsd.sdbor.edu> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
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


Jul 22 '05 #5
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:Os****************@TK2MSFTNGP15.phx.gbl...
Why would you want header HTML in a vcs file? I don't understand.

Ray at home

"Tom Petersen" <pe****@sdsd.sdbor.edu> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #6
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:Os****************@TK2MSFTNGP15.phx.gbl...
Why would you want header HTML in a vcs file? I don't understand.

Ray at home

"Tom Petersen" <pe****@sdsd.sdbor.edu> wrote in message
news:O9**************@tk2msftngp13.phx.gbl...
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

Jul 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Robert | last post: by
5 posts views Thread by lecichy | last post: by
5 posts views Thread by Tom Petersen | last post: by
1 post views Thread by Steve | last post: by
1 post views Thread by D. Shane Fowlkes | last post: by
1 post views Thread by Martin | last post: by
Sheepman
4 posts views Thread by Sheepman | last post: by
8 posts views Thread by victor.herasme | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.