473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 1709
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
Hello, I am trying to get output formatted from a non-php script that I post to. Example: <form method=POST action=www.myurl.com/ColdFusion.cfm> bla bla bla </form>
5
by: lecichy | last post by:
Hello. As in the topic, I use www to execute shell command, in this case 'ls -l' and i get output like: total 8 drwx------ 11 lecichy staff 4096 Oct 15 18:18 Maildir drwx---r-x 3...
5
by: Tom Petersen | last post by:
I am using a response.write to test the formatting of the output. I am supposed to get this: BEGIN:VCALENDAR VERSION:1.0 BEGIN:VEVENT DTSTART:20051022T090000Z DTEND:20051022T090000Z...
1
by: Steve | last post by:
Hello, I need help with formatting an output of an array. I have a two dimensional array that looks something like this: x x x x y y y y b b b b ....and so on...I use to just...
1
by: D. Shane Fowlkes | last post by:
Hey guys. I have a Repeater and a Template. One of the dataitems calls a helper function. The dataitem sends the record ID to the function and the function runs a complex query and returns a...
1
by: Martin | last post by:
Hi. My question seems to be somewhat primitive, but I cannot find an appropriate solution. Is it possible to control the number of digits displayed in the exponent part of the scientific...
3
by: mrdude | last post by:
i'm working on a program where one of the functions is to build mailing labels from a list of prospects. i'm having trouble figuring out how to set this up. i'm using vb.net and an access database....
4
Sheepman
by: Sheepman | last post by:
My quest, to put 100 random numbers in ten rows of ten. Then output the same to the screen and a file. My screen output is working,yeah! Text file, not so much. The data is getting there but not...
8
by: victor.herasme | last post by:
Hi, i am building a little script and i want to output a series of columns more or less like this: 1 5 6 2 2 8 2 9 5 The matter is that i don't know in advance how many columns...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.