Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Unable To Remove A File


My program was interrupted before completion. This caused one of the files to be close with no input so the file lenght is zero(0).

The next time the program was run an error occured when the file was opened for output. The error:
error 55: File already open

In an attempt to solve this I put in a routine to delete that file prior to attempting to open it. The Routine:

Private Sub Setfile(sFileName as string, fHandle as Integer)
On Error GoTo SetFile_EH1

Close #fHandle
Open sFileName For Input As #fHandle
'If file not there will cause Error 53 and exit sub
Err.Clear
Close #fHandle
'Make sure the file is closed
Kill sFileName
Exit Sub
SetFile_EH1:
If Err.Number = 53 Then
Exit Sub
Else
MsgBox "In SetFile, Error=" & Err.Number & " " & Err.Description
End If
End Sub

The problem is that when the Kill is called, it again creates an error 55: File already open

I have checked and called the Close statement prior to calling this sub routine to insure that that file handle was indeed closed. The File handle was called using freefile.

Can't seem to solve this one!

Anybody have any ideas?

TIA
Dick Deeds




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Unable To Add Another Row After Remove Row
I m facing a problem unable to add another row in my MSHFlexGrid after i delete 1 row from it. What is the problem actually?


Code:

Private Sub cmdRemove_Click()

MSHF2.RemoveItem (MSHF2.Row)

End Sub

Unable To Remove Ghost References
I have several dlls that I have been working on and they have been moved around during the development cycle for my current project. Now some of these dlls and the directories they were once living in have been deleted. I can not remove them from my project reference list. Does anyone know how I can clean this up.
Thanks,
Tim

Unable To Remove Multiple Selections From A ListBox VB6
I use the following piece of code to remove multiple item. But for some odd reason when the line .RemoveItem() is run, all the selected items are deselected hence I am able to remove just one item and not all the items. Is there a way to prevent .RemoveItem from deselecting all the previous selected items.

Private Sub cmdRemoveLocation_Click()

Dim strLocName As Variant
With Me.lstSelectedLocations
    If .MultiSelect > 0 Then
        For Each strLocName In .ItemsSelected
            .RemoveItem (strLocName)
        Next strLocName
    End If
End With

End Sub

I'd appreciate any kind of help...thanks

Path/File Access Error. Unable To Read Or Write The Specified File
Hi,


I am getting the following error

"Path/File Access Error. Unable to Read or write the specified file.

Unable to Display the Image"


Following is the Code i am using .
With ImgEdit1
.Image = gStrFilePath & "" & pImagefile
.Page = 1
.Display
.FitTo 1
End With


The OS is windows 2000 and i am using ImageEdit control

the variable gStrFilePath contains the Path of the file
PImagefile contains the Image Name . Image is Tiff image.


If i click OK on the error messages the application closes. If i run the application again i am able to display the same Image.


Pls Help me

VBA .exe File Unable To Run On PC Without VB
Hi,

I have built an exe file using VB 6. But I am not able to run it on a PC that does not have VB.

It runs fine on a PC with VB.

I also tried creating an installer file for that so that all the dependent files are automatically included in it. It runs, but crashes soon.

Can you help ?

Thanks.

VB .exe File Unable To Run On PC Without VB
Hi,

I have built an exe file using VB 6. But I am not able to run it on a PC that does not have VB.

It runs fine on a PC with VB.

I also tried creating an installer file for that so that all the dependent files are automatically included in it. It runs, but crashes soon.

Can you help ?

Thanks.

Unable To Run An Exe File Via PDW
Hi,
I have a vb project that I want to make a setup for.
I want to use the PDW of visual studio for that.
My project uses Access and MySQL as databases.
for connecting with MySQL I need a driver, for that a myodbc.exe file should be run.
How can I include in the setup the driver exe file and make the setup execute that driver during setup for registration?
I included the exe file in the setup and the setup just put it in the target computer as it is without executing him.
Please advise
Jo

Unable To Read .eml File Thru VB
Hi all,

I require to read the contents of a email file (.eml) saved from Outlook Express thru VB Code .. please help me out !!!

Unable To Open File..please Help!
Hi,

I am trying to open a dat file named test.dat (two column data, only numerics) from vb using the following code:


Code:
Private Sub command1_click()
Reset
Open "Test.dat" For Input As #1
Do Until EOF(1)
Line Input #1, A$
Loop
End Sub


when I run the code an error message appears saying Runtime error '55', "file already open". This happens despite my using the "Reset" command before the "open" command in the code. Why does this happen?

Please help! Thank you very much..

Unable To Open RTF File.. Pls Help
Hiiii,
I am oppening a RTF file for editing through VB and at the sametime I want to open the RTF file in a Rich text box.

But after oppening the file for Editing I am unable to open up it in the Rich Text Box.

It says "The specified Path/file name cannot be accessed or is invalid"

If I first open it in the ritch text box and then open for editing its Ok.... but I want it the other way around.

I need to first open it for editing and while it is still opened ... open it in a Ritch Text box (jn the form).

Can this be done.
How can we check if a Word or RTF file is already opened.

Thank
Sam

Unable To Read File
So, I am trying to fix up an excel 2000 spreadsheet for someone and it is giving the above error message when you try to load it, then it doesn't load at all. I was able to get Excel 2002 to run a repair on it on load and give him the spreadsheet back in an openable format (though apparently some of the data is scrambled on various worksheets). Does anyone know a really good repair and recovery tool?


To err is human. To really foul things up requires a computer.

Unable To Kill The Read-only File
I am using Kill (*.xyz) to remove few files from folder. But, if any of the xyz files to be killed is read-only, it is not getting killed. I am getting the error 'Path/File access error'. How can this be resolved?

Unable To Update Existing File..pls Help
hey guys i had this code of mine. It actually checks if same application is open if yes it will only updates the records it has but if not it will insert a new record. the problem is it doesnt update it only replaces..

here my code:

rs.Open "Select * from tblLogs", dBase, 3, 3

If txtApp.Text = "" Then
ElseIf txtApp.Text = rs.Fields("app") Then
dBase.Execute ("Update tbllogs set logs='" & Replace(txtLog.Text, Chr(13), "Enter") & "' where app= '" & txtApp.Text & "'")
Else
dBase.Execute "Insert into tblLogs values ('" & txtEmpNo.Text & "','" & wstation & "','" & txtApp.Text & "','" & Replace(txtLog.Text, Chr(13), "Enter") & "', '" & FormatDateTime(Now, vbShortDate) & "','" & FormatDateTime(Now, vbShortTime) & "','0')"
End If

Thanks in advance!

Unable To Use UDL File In Data Environment
When I use a udl file as the ConnectionSource of a DEConnection, I get the following error : "Failed getting Rowset(s) from current data source"
The DEConnection won't accept my udl anywhere, no matter what I put in my udl and no matter where I specify the connection string.

I have altered the udl file numerous times, first I used the Jet engine, then ODBC, File DSN, SYSTEM DSN, nothing worked, I have made sure that the UDL is consistent with the ODBC DSN, but it just doesn't accept it.
It works fine when I use ODBC but I would like to know how to use a UDL since it is simpler and more advanced.

Hope someone can help,

Shaul

Unable To Create An Index In MDB File
I am not able to create an index in existing table in a MDB file either using ADOX method or "Create Index" Statement.

I am using Adox 2.8 and ado 2.7 and access 2003

Any Suggestions.
Thanks.

Unable To Generate Log File During Setup
I have a setup made with VB setup tool. It usualy run good. Yesterday, I have tried to run it under win 2000 pro (not my computer). As soon as I click on the setup Icon, a msg appeared, saying: 'Unable to generate a log file'.

Did anyone ever had this problem!!!

Help!

thanx

aaahhh!!!

Unable To Delete A File While It's Being Written To
Is there a way to detect if I can delete a file without handling a error? This has come up a few times, the last time being we have scripts we generate (replace a default username with an incremented username) and then perform another similar operation on resulting file. The problem is that if you don't do some wait time in between then the first file you create is not always done writting when you try and get it again for the second operation. Is there any way to detect that nothing is writing to the file?

Unable To Move The Existing File
Unable to move the existing file ...?

Unable To Open Excel File On Office-Xp
Can anybody please help me.....I am opening a excel file through VB code which is as follows...

Dim xlapp as object
dim xlbook as object

Set xlApp = CreateObject("Excel.Application") 'New Excel.Application

Set xlBook = xlApp.Workbooks.Open("c: est.xls", , True)

This is working fine on Office-97,Office-2000 but it is not working on office-Xp , When I am running this code on the machine which is having a Office-Xp I am getting an error message...
'Unable to get the open property of the workbooks class'

Can anybody help me.......

.exe Building Disabled, Unable To Build .exe File!!
Hi,

Iīm not able to build any exe file, cause itīs disabled. After several bootings and programm kills it still ainīt working. Has anybody some idea how to re-enable it ??

- Whoops - Unable To View File" Message
I have an application that processes MS-Word files, and I enable the user to view the files through the WebBrowser control (that seemed like the best option to display a Word doc, as the OLE control sucks). Anyway, I have no problems displaying any file in the webbrowser control when I run the app from my development box (Win 98 laptop). However, when the app is run on the user's machine (Win XP Pro), while the app does display most documents without a problem, on longer ones, she is getting the message "Whoops - unable to view this file (GP) - QuickView Plus". Any idea why or how to fix it?

Unable To Find File Error (access 2000 And VB6)
Hello,
  Ok I am working on a project for work and I was wondering if someone can answer these questions for me.

Is Access 2000 compatible with VB6 I have downloaded the service pack 5.

I am trying to access the the database so that i can update the fields that are in the database but for some reason it keeps on giving me and error. The error is simply
"Cannot find the file "tracking.mdb"" I checked to see if the file was spelled right I checked to see if it is in the same directory that the application is IT IS. I am using this code to open the database

Set AddCompanyas opendatabase(sApPath & "/tracking.mdb")

I tried everything that I could think of and yet no pevail
Please help
Thank you

CR8 - Unable To Change Location Of Database File Or Tablename
Hi!
I have just started using Crystal Reports 8 with VB 6...I have some Report templates already made in VB6...while making those reports tables were created as follows:

Server Type: ODBC MS Access 97 Database
Server Name: MS Access 97 Database
Database: V:meenakshisystem1.mdb (some mapped drive from another computer)
User ID: Admin

Now say, i want to run this project on the client side...obviously in that case, the server name (here it is access so may not change, but in the case of ms sql server 2000, the server name may change), database would change....
i want all my templates to still run....how is that possible...i have written the following piece of code, but it is still not working...i have searched lots on the forums etc. but i am sure i am missing somethind very minute somewhere....pasted below is my code:
----------------------------------------------------
Dim crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Dim cTable As CRAXDRT.DatabaseTable

Dim myServerName As String
Dim myDatabaseName As String
Dim myTableName As String

Private Sub Form_Load()

' this rptReport1 report is prepared using EMPLOYEE table in the System1.mdb and i want to change it to use the CUSTOMER table in Sytem1.mdb at runtime or i want to change the location of my database file System1.mdb from V:meenakshi to some other place

Set Report = crxApplication.OpenReport ("V:meenakshi_Conversion
ptReport1.rpt", 1)

frmViewer.Show vbModal

For Each cTable In Report.Database.Tables

myServerName = cTable.LogOnServerName
myDatabaseName = cTable.LogOnDatabaseName
myTableName = cTable.Name
myLocation = cTable.Location

' i am just printing the servername, database name and tablename that r currently used in the rpt
Text1.Text = myServerName
Text1.Refresh
Text2.Text = myDatabaseName
Text2.Refresh
Text3.Text = myTableName
Text3.Refresh

'now i want to change the table name to CUSTOMER .... rest everything remains same ...or may be i move my database file, that is System1.mdb somwhere else and try to ask the report to use this database location now... in that case, table name remains same but database name changes to reflect the new location
cTable.Name = "EMPLOYEE"
cTable.Location = cTable.Name
cTable.SetLogOnInfo myServerName, myDatabaseName, "admin", ""
myServerName = cTable.LogOnServerName
myDatabaseName = cTable.LogOnDatabaseName



' i am just printing the servername, database name and tablename that r now used in the rpt
myTableName = cTable.Name
Text4.Text = myServerName
Text4.Refresh
Text5.Text = myDatabaseName
Text5.Refresh
Text6.Text = myTableName
Text6.Refresh


Next

frmViewer.Show vbModal
End Sub
--------------------------------------------------
thanks,
regards,
meenakshi

Unable To Properly Import .reg File Data That Contains Carriage Returns
This is a bit of an odd one. You don't actually need to use Visual Basic to test or perhaps even solve this problem, but since it has come up as part of a VB project I am posting it here.

I have written a registration module for our software that works by encrypting the windows key using our password and saving it in the customer's registry. However the system does not always work for everybody so customer support needs a way of helping them register. I am working on a new method for this that involves creating a .reg file using a key that they send to us. The idea is to send this .reg file to them, which they can double-click on to add the information inside to their registry, which will register their software, and off they go.

The problem is that the encrypted key that is stored in the registry contains carriage returns. This is not a problem when the entry is written directly to the registry using VB code. However, it turns out that if you try to write the information using a .reg file, it will not work for multiple lines. For instance, a reg file that looks like this:


Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareTest]
"Serial"="testing here we go"
Will work fine. However, a file that looks like this:


Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareTest]
"Serial"="testing here we
go"
Will not add the information to the registry at all. This even happens if the information that is in the second one was taken directly from the registry - what I mean is, if the information in Serial had a carriage-return while it was in the registry, exporting the value using Export in regedit would give me the second example that I posted. However, even though regedit wrote out the file in that manner, the information in the file will not be correctly entered into the registry when I double-click on the file.

You can try this for yourself by creating a textfile called test.reg and putting in the examples I have shown here.

I realize that a way around this is to remove carriage returns from the serial however this creates subsidiary problems for me due to the entrenched use of this system among our customers.

Thanks in advance,

-Adrian

Vb 6.0 Error When Hit Run: Unable To Initialize Appliation Lock File Terminating The
application.

when I hit Run this error message is thrown..

can some one let me know what could be reason.
thanks
nath

Remove File Extension From A String Of A File Path
I need to take a file extension off a string:


VB Code:
cPDB = flbMain.List(nPDB)


returns:

"C:my documents est.pdb"

and I want to remove the ".pdb"

How?

Thanks for any help

- Jake

Remove File Extension From File List Box
in my program i want File1(filelistbox) to display a list of text files(010101.txt,010102.txt,etc).when i select a file in the list, its contents appear in a rich text box. is there anyway to hide the extensions(.txt) of the files in the filelistbox? by using,

Code:
Text1.Text = Left(File1.List(File1.ListIndex), Len(File1.List(File1.ListIndex)) - 4)
i can make the name of the selected item(w/o the ".txt") appear in a textbox. could i somehow use this approach in creating a filelistbox that only displays the names of files, and not their extension? thanks in advance. jrob. www.jrob.tk

Remove Contents Of A File Before Writing To A File
is there a way of deleting the contents of a text file and then writing it to the same text file.
i have Sub addressbook()
Dim address As String
Dim lastadd As String
Set oaOutlookApp = CreateObject("Outlook.Application")
Set test = oaOutlookApp.CreateItem(olMailItem)
Set onMAPI = oaOutlookApp.GetNameSpace("MAPI")
Set ofFolder = onMAPI.Folders.GetFirst.Folders("Contacts")
'Set ofFolder = onMAPI.Folders.GetFirst.Folders(1)


address = ofFolder.Items.GetFirst
lastadd = ofFolder.Items.GetLast
i = 1
Open App.Path & "addressbook.txt" For Append As #1
Do Until address = lastadd
i = i + 1
address = ofFolder.Items(i - 1)
Print #1, address
'MsgBox address
Loop


End Sub



but what this does is writes to the addressbook.txt but it adds it to the bottom of the file, and then it keeps adding it to the file, what i want to do is everytime i run this program it should only come up with on set of results
any suggestions

How To Remove A Key From An INI File?
How do you remove a key from an INI File? What about a header?

Thanks!

Remove CRLF From A File
I have written a routine which is designed to remove carriage return line feed characters from a file.

'Step one: Place the contents of the file into a variable
strRecordData = Input(LOF(1), #1)
'Step two: Replace all crlf with null
strRecordData = Replace(strRecordData, vbCrLf, "")
'Step three: Put the data back into a new file
Print #2, strRecordData

The ironic part is that, although the string variable does not contain any CRLF once this routine has run, the "Print" statement places what appears to be a single crlf at the end of the file. Once the file is opened in notepad, and you press ctrl+end you get one spot past the last character in the file.
Does anyone have a suggestion for a better way to go about this?

How To Remove Items From App Log File ?
Hello all,

I am using the App Loging feature to create a log file for logging events in my program. Everything is working fine except it's logging some additional stuff that I do not want nor have asked for;

Here's My Simple Code....
________________________________________________________________
Private Sub Form_Load()

Dim MyTime = Now()

' Sets App Event log path. Arg.2 forces logging to this path & File

App.StartLogging "E:Log.Txt", 2

'Log event writes MyTime & Message to E:Log.text. Required 2nd Arg. 4 specifies it's information

App.LogEvent MyTime & " Program Started", 4 '
'
End Sub
__________________________________________________________________


And Here's what the output looks like in my "Log.Txt" file.....

Information Application E:Log.Txt: Thread ID: 2100 ,Logged: 3/11/2005 6:01:44 PM Program Started


Here's What I want......

3/11/2005 6:01:44 PM Program Started


But I am willing to settle for this......

3/11/2005 6:01:44 PM Program Started :Information Application E:Log.Txt: Thread ID: 2100 ,Logged


Any Ideas or Suggestions?


Thanks.

Remove File View?
is there any way i could put a .txt file on a web server and create a program that will display the contents of the .txt allong with the other exe i play to place on the server... for instance if my files wer set out as follows...

|-Patch 1
| |-info.txt
| |-file.exe
|--Patch2
| |-info.txt
| |-file.exe

then the program would display

{filename} - {filesize}
{Contents of info.txt}
{download link}

for each folder?

if this possiable and can it be done without using advanced stuff because im a bit new to VB but im willing to learn just need a bit of a shove allong the way

thanks in adavnce

How Do I Remove The Extension From The File Name.
I have hundreds of text files that have been created through Excel that need to have the .TXT extension removed.
I have the files in one folder and the files names listed in a column in Excel. I have a code that opens in a New Workbook a file that is listed, does several Search/Replaces, saves the file as text in a different folder, closes the Workbook and loops to the end of the file list.
All of the files have the .TXT extension which needs to be removed.
I've tried to search the Forum for the answer but came up with no solution. The searches bring up lots of threads that have nothing to do with what I searched for.
I have no training in VB, I just alter already existing code.

Thanks for your help.

Remove Code From New File
I have several templates, and at the end of creating a new file I take the existing data sheet, copy it to a new file and then close the original. However, this leaves any macro code associated with that (or those) sheet(s) in the new file. I have used the following code (taken from the web; it works great, thanks to whoever wrote it!) in order to fully remove code from a file, but is there a way to remove just the code within the worksheets before I copy them? Thanks!


Code:
Sub DeleteAllVBA()
Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents


Set VBComps = ActiveWorkbook.VBProject.VBComponents

For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, _
vbext_ct_ClassModule
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp

End Sub

Remove Front Of File
hi, how can i have a file open for binary and input data to it and read from it but also delete the first so many chars? i know the 'open for binary' and 'get' and 'put' but how do i remove stuff from the start of the file?

Remove File From Folder
i have a folder with about 50 other folders in it and in each of those folders there are two or three mp3 files. does anyone know how i can remove all the files from those folders and put them all together in one new folder. so basically have one new folder with about 100 mp3 files thanks

Remove File Extention
hi

i am searching a directory and listing all the filenames with its extention to a list box and then i am trying to list all filenames without the extention to another list box.

this is the code i am using and i can split the filename and the extention but its listing the filename and extention in the list box separatly. tell me how i can remove the extention and list only the filename.

Dim s As String
Dim i As Integer
Dim num() As String

List2.Clear
s = Dir$("img")
While Len(s)

List2.AddItem s ' "s" is the file name like "40.icon"

num = Split(s, ".")
For i = 0 To UBound(num)
List3.AddItem num(i)
Next i
s = Dir$

Wend
Debug.Print "ms " & List2.ListCount

regards,

shifan

Remove File Extension
I have a browse button and a textbox. My browse button browses for a file, then places the file title in the textbox. I want the extension to be removed. All I want it to say in the text box is the title without extension (for example from Hello.bsp to Hello). BSP is the only extension that will be in the box, if that helps. How can I achieve removing the extension?

Remove File From Filelistbox
is it possible to remove a selected file from the file list box, and can it lists sub dirs with the files in those folders?

What's a way I can list all the files in a folder, including it's subfolders and what's inside those, and being able to removed the selected files. How would I be able to write this to a txt file?

Remove Binary File
How can I remove a binary file my program created? I know if its a filesystem object I can use the delete method. But for binary files you have to use "open ...as binary"

any ideas? Thanks.

Remove Line From Ini File
i have a program that stores data from a listbox(has file name) and array(has file path) into an .INI file before the user closes the program.

first it stores the count of the listbox in the "Count" keyname under the "List" Section.

then it loops from 1 to the count storing the file name and file path
in key names like this

'i have a module that has a funtion writeInfoINI that uses the
'writeprivateprofilestring API call
for x = 1 to list.count
WriteInfoINI app.path & "INIFileName", "List", "FileName" & x, lst.list(x)
WriteInfoINI app.path & "INIFileName", "List", "path" & x, ListPath(x)
filepath^ section^ ^Keyname ^Keyvalue
next x

I needed to know if 1 day the user has 15 entries in the list, then the next only like 5, can i remove the ini entries from 6 to 15 fromt the file?

Thanks in advance
AC

How To Remove Characters From End Of A Big File ?
hi .
my problem is about removing many characters from end of a big file !

for example i have a file and the file have size like 100 MB .
this file is no a text file .
i will delete 200 KB from end of this file .
if i open this file and read it to a string variable the CPU goes to 100% and program will hanged for minutes !
but i don't want it !
i will do it in few seconds !

please help me .

thanks .

[VB6] Remove Text From A File
I am attaching a text file that I need code to remove all of the text up to the word WRID and then save the file with the change.

Thanks in advance for your responses...

Remove All But File Name In String
Hellow,

I am displaying file name paths but i would like remove all charaters before the file name from a string.
eg,

X:Some DirFolder Namedeeptree hefile.txt
X:Another DirFileName.xxx

returns: thefile.txt
FileName.xxx

Remove Part Of A File Name......
Ok how would you remove part of a file extension ie: .comp

C:Documents and SettingsAlanMy DocumentsMy Pictures2002-01 (Jan)Book Front.jpg.comp

to

C:Documents and SettingsAlanMy DocumentsMy Pictures2002-01 (Jan)Book Front.jpg

Remove First Line Of File
I have a file which I need all the contents of except for the first line. I'm using this:
VB Code:
Open App.Path & "header_" & TESTNAME & ".dat" For Input As #nfile            Line Input #nfile, strHead            Do While Not EOF(nfile)                Line Input #nfile, strtemp                strHead = strHead & strtemp            Loop        Close #nfile


And I'm wondering if there is a better way to do this. I was using this:
VB Code:
Open App.Path & "header_" & TESTNAME & ".dat" For Input As #nfile            strHead = input(LOF(nfile), #nfile)        Close #nfile
until I realized I didn't want the first line of the file.

Remove File Association
I have a dialog where the user puts in a extension they what to associate with my app, now how do i make it so when they click on "Remove File Association" it loads a listbox with all the file associations my program has and when the user clicks on one and press the command button "Remove" it removes the file association from program and from the list?

heres my code for association:

VB Code:
Public Sub CreateAssociationCustom()    Dim sPath As String     CreateNewKey Form4.ext.Text, HKEY_CLASSES_ROOT   SetKeyValue Form4.ext.Text, "", "Notepad2k3.Document", REG_SZ    CreateNewKey "Notepad2k3.Documentshellopencommand", HKEY_CLASSES_ROOT      SetKeyValue "Notepad2k3.Document", "", "Notepad2k3 Document", REG_SZ    sPath = App.Path & "Notepad2k3_Lite.exe %1"   SetKeyValue "Notepad2k3.Documentshellopencommand", "", sPath, REG_SZ      MsgBox "The file association has been made!"   End Sub


edit:
bah, heres all the source code
http://www.vbforums.com/showthread.p...hreadid=231664

Anyone Know How To Remove Formatting From A File?
Does anyone know how to programmatically remove formatting in a file? E.g. if you open a .csv file in Wordpad and save it, you get a message:
This will remove all formatting from the file. Do you wish to Continue? Yes/No (or something like this)

I'm reading in the contents of a .csv file into a series of arrays.
Code:
Do While Not EOF(fileNo)

ReDim Preserve array1(1 To i), array2(1 To i), array3(1 To i), array4(1 To i)
Input #fileNo, array1(i), array2(i), array3(i), array4(i)
i = i + 1

Loop
If my file is opened in Notepad, it reads as follows:
IH,30102002,29112002,12122002
IE1110022,IE111002250409,26112002,EUR
IE1110022,IE111002290412,26112002,EUR
IE1110130,IE111013060466,08112002,EUR

The trouble is that my code is reading in the following:
array1(0) = IH
array2(0) = 30102002
array3(0) = 29112002
array4(0) = 12122002IE1110022

array1(1) = IE111002250409
array2(1) = 26112002
array3(1) = EURIE1110022
array4(1) = IE111002290412

It's not recognising the Carriage Return Symbol as the End of the Line

When I open the file in Wordpad and save it, I get the following message:
You are about to save this document in a text-only format, which will remove all formatting. Are you sure you want to do this?

If I accept, and run my program, there is no problem. i.e. It reads in as follows:

array1(0) = IH
array2(0) = 30102002
array3(0) = 29112002
array4(0) = 12122002IE1110022

array1(1) = IE1110022
array2(1) = IE111002250409
array3(1) = 26112002
array4(1) = EUR

Any suggestions?

Copyright Đ 2005-08 www.BigResource.com, All rights reserved