![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
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 |