Hi all. I'm brand new here, been on the site for about 1 minute, and I have a question. Not sure if I'm in the right thread, but the question is for VB6. This may sound basic, but I am making a program, that will open WAV music files by pressing the command button 1 (some kind of browse button. Open the file, rename it- a combobox has a drop down with several names you can select to rename it. once the combobox is on the one you want to rename it, you press the execute button, and it renames the file. then you hit the export button, and it replaces the file that was named the same as your file (in the set directory in program files). I am Could you guys make me up some codes for this? Thanks so much.

Browse button = Microsoft Common Dialog Control (Press CTRL+T and select it)

Open the file... Here is where you terminology is wrong as you do not need to open a file to rename it but the following is for opening any file...

In help on index tab look up the following...

FreeFile Function
Open Statement
Line Input Statement
Input Function
Close Statement

As for opening and playing *.wav files, see sndPlaySound API or the PlaySound API...

Rename a file = the Name Statement (once again on index tab of the help files)

The "export" will happen when your code executes the name statement...

As for code, let us see what you have tried so far...

Good Luck

On another note. I have made a program that has three combo boxes that have text in them. The text allows you to scroll down in the combobox, click the one youwant to add, then hit the add button. I already made the code for that, but when I hit the add, it pastes it at the end. Is there a code that automatticaly pastes that text to a newline in the textbox? Also, thanks so much for your help!

Edited 6 Years Ago by 3d0army: n/a

You need to set the textbox multiline property to true. Then you can use...

Text2.Text = vbNewLine & Text1.Text

Good Luck

I put the code in, but when I use it, it pastes one line down from the top, and stays until I backspace the combo text. I want it to go to the next line after the previous. So basically, in the command button I want a code that simulates pressing the enter button after the code is pasted, to go to the next line.

Edited 6 Years Ago by 3d0army: n/a

Never mind, I finished that code. I tried some more variations with the vbNewLine - nothing else. But thanks so much! Also, on the first post. What I basically want, is a combo box, and a browse button. You open a WAV - not playing it - (it is a program that replaces a standard WAV file into a program files C:. It imports, has a combobox that has names of the file you are replacing, renames it to that name, and adds it to c:. ) thanx so much

This article has been dead for over six months. Start a new discussion instead.