O
Orga Hades
Greetings.
I need some assistance in determining the proper code for a Word macro I’ve written. Here’s the basic set-up.
I have a user form that contains six image boxes. Below each image is a text box, and above the image is a label. When I click the label an “Open file” window appears and I can then choose a .jpg file to appear into the image box. The name of the file then appears in the text box.
So far so simple.
I also have another text box into which I will type a word(boat, for instance). Then when I click a command button the six .jpg files will be renamed to the word ‘boat’ and numbered sequentially (boat_001, boat_002, boat_003, etc.), then copied into another folder.
This macro works wonderfully… unless one of the image boxes and corresponding text box is left blank, in which case I get the ominous “path not found” error. I know I need to create some sort of “IF THEN ELSE” statement, but I don’t know enough about programming to code it myself.
Would anybody be willing to help me out with this one? Here is the code for the command button:
Private Sub command_photos_Click()
Dim strUnprocessedPhotos As String
Dim strReadyToSell As String
strUnprocessedPhotos = "C:\unprocessed photos”
strReadyToSell = "C:\ready to sell\" & text_master_file.Text
FileCopy strUnprocessedPhotos & text_photos1_filepath.Text, strReadyToSell & "_001.jpg"
FileCopy strUnprocessedPhotos & text_photos2_filepath.Text, strReadyToSell & "_002.jpg"
FileCopy strUnprocessedPhotos & text_photos3_filepath.Text, strReadyToSell & "_003.jpg"
FileCopy strUnprocessedPhotos & text_photos4_filepath.Text, strReadyToSell & "_004.jpg"
FileCopy strUnprocessedPhotos & text_photos5_filepath.Text, strReadyToSell & "_005.jpg"
FileCopy strUnprocessedPhotos & text_photos6_filepath.Text, strReadyToSell & "_006.jpg"
End Sub
Any assistance at all would be honorably appreciated!
Thanks!
-Orga
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
I need some assistance in determining the proper code for a Word macro I’ve written. Here’s the basic set-up.
I have a user form that contains six image boxes. Below each image is a text box, and above the image is a label. When I click the label an “Open file” window appears and I can then choose a .jpg file to appear into the image box. The name of the file then appears in the text box.
So far so simple.
I also have another text box into which I will type a word(boat, for instance). Then when I click a command button the six .jpg files will be renamed to the word ‘boat’ and numbered sequentially (boat_001, boat_002, boat_003, etc.), then copied into another folder.
This macro works wonderfully… unless one of the image boxes and corresponding text box is left blank, in which case I get the ominous “path not found” error. I know I need to create some sort of “IF THEN ELSE” statement, but I don’t know enough about programming to code it myself.
Would anybody be willing to help me out with this one? Here is the code for the command button:
Private Sub command_photos_Click()
Dim strUnprocessedPhotos As String
Dim strReadyToSell As String
strUnprocessedPhotos = "C:\unprocessed photos”
strReadyToSell = "C:\ready to sell\" & text_master_file.Text
FileCopy strUnprocessedPhotos & text_photos1_filepath.Text, strReadyToSell & "_001.jpg"
FileCopy strUnprocessedPhotos & text_photos2_filepath.Text, strReadyToSell & "_002.jpg"
FileCopy strUnprocessedPhotos & text_photos3_filepath.Text, strReadyToSell & "_003.jpg"
FileCopy strUnprocessedPhotos & text_photos4_filepath.Text, strReadyToSell & "_004.jpg"
FileCopy strUnprocessedPhotos & text_photos5_filepath.Text, strReadyToSell & "_005.jpg"
FileCopy strUnprocessedPhotos & text_photos6_filepath.Text, strReadyToSell & "_006.jpg"
End Sub
Any assistance at all would be honorably appreciated!
Thanks!
-Orga
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-