|
-
Aug 28th, 2001, 11:03 AM
#1
Thread Starter
New Member
I need to save....Any Ideas???
Hello,
At the moment I am busy trying to create a form in Microsoft Outlook that will be used as an error log at work. Basically I have got three fields so far. (Name, Urgency & Description). I have been able to send the data to myself via e-mail. However I now want to save to entered data into a log file rather that have all errors sent to myself via e-mail.
I would appreciate it if somebody could help me out by giving me the VB Script that I need to be able to save the data that I have collected, to a file.....rather than an e-mail
Thanks,
Darren
-
Aug 28th, 2001, 11:05 AM
#2
Frenzied Member
use fso object,
open the file for append and add the error to it!!
-
Aug 28th, 2001, 11:07 AM
#3
Thread Starter
New Member
-
Aug 28th, 2001, 11:12 AM
#4
Frenzied Member
goiing to lunch, wait after!!
look there :
http://www.stardeveloper.com/articles/050301-6.shtml
and click next on the bottom, you will see
every method and every property!!
have fun!!!
-
Aug 29th, 2001, 03:41 AM
#5
Thread Starter
New Member
Does not seem to work.
Basically I have of string of text stored in a variable called Item.Body And I want to save it to a file Called "C:\errorlog.txt". I will be calling a Function called Item_Save, and I wanted to know how to do this within the function......Any Ideas???
-
Aug 29th, 2001, 06:15 AM
#6
Perhaps you can use these function for file manipulations. But these function are made in javascript
Code:
<%
var BaseLocationForTextFiles;
var FileName;
var Overwrite;
var TextToPrint;
var FileStreamObject;
var WriteFile;
var TextOutput;
var PrintOutput;
BaseLocationForTextFiles=Server.MapPath("\\")+'\\filedir\\';
function CreateTextFile(Filename,Overwrite,TextToPrint){
var FileStreamObject=Server.CreateObject("Scripting.FileSystemObject");
if (Overwrite=='' || Overwrite=='0' || Overwrite==false){
Overwrite=false;
} else {
Overwrite=true;
}
Filename=BaseLocationForTextFiles+Filename;
WriteFile=FileStreamObject.CreateTextFile(Filename,Overwrite);
WriteFile.Writeline(TextToPrint);
FileStreamObject=undefined;
WriteFile=undefined;
}
function OpenTextFileForReading(Filename){
var FileStreamObject=Server.CreateObject("Scripting.FileSystemObject");
Filename=BaseLocationForTextFiles+Filename;
var TextOutput=FileStreamObject.OpenTextFile(Filename,1,false);
while (!TextOutput.AtEndOfStream){
PrintOutput=TextOutput.ReadLine();
if (!TextOutput.AtEndOfStream){
TextOutput.SkipLine();
}
}
TextOutput=undefined;
FileStreamObject=undefined;
return(PrintOutput);
}
function OpenTextFileForAppending(Filename,Mode,Create,TextToPrint){
var FileStreamObject=Server.CreateObject("Scripting.FileSystemObject");
if (Create==''){Create=false}
if (Mode=='' || Mode=='8' || Mode==ForAppending){
Mode=8;
} else {
Mode=2;
}
Filename=BaseLocationForTextFiles+Filename;
TextOutput=FileStreamObject.OpenTextFile(Filename,Mode,Create);
TextOutput.WriteLine(TextToPrint);
TextOutput=undefined;
FileStreamObject=undefined;
}
%>
-
Aug 29th, 2001, 09:44 AM
#7
Thread Starter
New Member
Thaks to all.....I have sorted it now!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|