Results 1 to 7 of 7

Thread: I need to save....Any Ideas???

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Midlands
    Posts
    13

    Exclamation 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

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    use fso object,
    open the file for append and add the error to it!!

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Midlands
    Posts
    13
    How do I do that????

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    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!!!

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Midlands
    Posts
    13
    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???

  6. #6
    kayoca
    Guest
    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;
      
    }
    
    %>

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Midlands
    Posts
    13
    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
  •  



Click Here to Expand Forum to Full Width