A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook Script Question about using TXT.File



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 4th 08, 04:49 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default Outlook Script Question about using TXT.File

Hi All,

I'm use a custom Form , and store some information to .txt file, all is ok
I store / save and read these information without any Pb, but from time to
time I need to replace a the content of a line and I don't found the
command that allow me to replace a line knowing it row

to add line I use something like this

Set objFile = objFSO.OpenTextFile(myfile,forereading)
myNewitem
objFile.WriteLine(myNewitem)
......

and to read the file I put the content of the file to a list and get the
info from this list




Ads
  #2  
Old December 4th 08, 06:24 PM posted to microsoft.public.outlook.program_forms
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook Script Question about using TXT.File

Am Thu, 4 Dec 2008 16:49:53 +0100 schrieb bbnimda:


That object offers a ReadLine function, did you try that?

i don't know how that function works. I'd read all the file, then use the
Split function. If you split all the content by the line delimiter, which
usually is vbCRLF, an array will be returned with one item per line.

--
Viele Gruesse
Michael Bauer - MVP Outlook

: Outlook-Kategorien? Category Manager ist die Lösung
: VBOffice Reporter für Datenanalyse & Berichte
: http://www.vboffice.net/product.html?pub=6


Hi All,

I'm use a custom Form , and store some information to .txt file, all is

ok
I store / save and read these information without any Pb, but from time to
time I need to replace a the content of a line and I don't found the
command that allow me to replace a line knowing it row

to add line I use something like this

Set objFile = objFSO.OpenTextFile(myfile,forereading)
myNewitem
objFile.WriteLine(myNewitem)
.....

and to read the file I put the content of the file to a list and get the
info from this list

  #3  
Old December 5th 08, 10:33 AM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default Outlook Script Question about using TXT.File

I know Readline to get the content of the line but what I want to do is
to replace the content of a line by new information

eg:

the content of the line 75 is:

AAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBB

I Want to replace the line 75 by
BBBBBBBBBBBBBBB BBBBBBBBBBBBBBB

I hope it's clear




"Michael Bauer [MVP - Outlook]" a écrit dans le message de
news: ...
Am Thu, 4 Dec 2008 16:49:53 +0100 schrieb bbnimda:


That object offers a ReadLine function, did you try that?

i don't know how that function works. I'd read all the file, then use the
Split function. If you split all the content by the line delimiter, which
usually is vbCRLF, an array will be returned with one item per line.

--
Viele Gruesse
Michael Bauer - MVP Outlook

: Outlook-Kategorien? Category Manager ist die Lösung
: VBOffice Reporter für Datenanalyse & Berichte
: http://www.vboffice.net/product.html?pub=6


Hi All,

I'm use a custom Form , and store some information to .txt file, all is

ok
I store / save and read these information without any Pb, but from time
to
time I need to replace a the content of a line and I don't found the
command that allow me to replace a line knowing it row

to add line I use something like this

Set objFile = objFSO.OpenTextFile(myfile,forereading)
myNewitem
objFile.WriteLine(myNewitem)
.....

and to read the file I put the content of the file to a list and get the
info from this list



  #4  
Old December 9th 08, 09:55 PM posted to microsoft.public.outlook.program_forms
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook Script Question about using TXT.File





Sorry, I didn't mean the ReadLine but the WriteLine function. However, try
my suggestion: If you have all of the lines in an array, you can change them
easily and then write everything back. That shouldn't be a problem as long
as you don't have to write very huge files.
--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Fri, 5 Dec 2008 10:33:37 +0100 schrieb bbnimda:

I know Readline to get the content of the line but what I want to do is
to replace the content of a line by new information

eg:

the content of the line 75 is:

AAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBB

I Want to replace the line 75 by
BBBBBBBBBBBBBBB BBBBBBBBBBBBBBB

I hope it's clear




"Michael Bauer [MVP - Outlook]" a écrit dans le message de
news: ...
Am Thu, 4 Dec 2008 16:49:53 +0100 schrieb bbnimda:


That object offers a ReadLine function, did you try that?

i don't know how that function works. I'd read all the file, then use the
Split function. If you split all the content by the line delimiter, which
usually is vbCRLF, an array will be returned with one item per line.

--
Viele Gruesse
Michael Bauer - MVP Outlook

: Outlook-Kategorien? Category Manager ist die Lösung
: VBOffice Reporter für Datenanalyse & Berichte
: http://www.vboffice.net/product.html?pub=6


Hi All,

I'm use a custom Form , and store some information to .txt file, all

is
ok
I store / save and read these information without any Pb, but from time
to
time I need to replace a the content of a line and I don't found the
command that allow me to replace a line knowing it row

to add line I use something like this

Set objFile = objFSO.OpenTextFile(myfile,forereading)
myNewitem
objFile.WriteLine(myNewitem)
.....

and to read the file I put the content of the file to a list and get the
info from this list

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook Script: How to create / delete txt file bbnimda Outlook - Using Forms 6 February 15th 08 02:08 PM
Outlk 2k3 Script: Checking if an application/file exist news.microsoft.com Outlook and VBA 1 November 30th 06 03:15 PM
Outlk 2k3 Script: Saving Excel File programticaly from OUTLOOK SCRIPT news.microsoft.com Outlook and VBA 3 November 22nd 06 04:33 PM
outlook 2k3 Script: how to Save Mail body to txt file news.microsoft.com Outlook and VBA 5 November 7th 06 03:23 PM
Outlook .prf file and cmd script wont change exchange server setti HEU Outlook - Installation 1 June 23rd 06 07:15 PM


All times are GMT +1. The time now is 01:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.