PDA

Click to See Complete Forum and Search --> : How do I rename this string?


madddog
Jan 16th, 2000, 11:47 AM
Evening Gentlemen,

I have a batch process program that I am creating, and I have hit a wall. I have a string that I created from a listbox and I need to rename it so the file will save as "samename" but with a .doc extension.

'Here is the string with filename
List2.list(cnr)

newname = (List2.List(cnr)_______.doc

Set swApp = Model.SaveAs2(newname, 0, True, True)

Any help would be greatly appreciated

Mike

X_Darknight_X
Jan 16th, 2000, 11:56 AM
Just use a & or + inbetween the name of the document and the extension.

------------------
David Underwood
Cannabatech Corporation

ICQ - 14028049 (http://www.icq.com/14028049)
E-mail - darknight23@hotmail.com




[This message has been edited by X_Darknight_X (edited 01-17-2000).]

madddog
Jan 16th, 2000, 12:57 PM
tried using this:

newname as Object
newname = (list2.list(cnr) + ".doc")

I get a "object variable or with block variable not set" Error Message

anything else to convert this please!!!!!


Mike

Iceman
Jan 16th, 2000, 01:08 PM
not sure of your code i have something similar i wrote

Filename = Filename & ".doc"

that DOES work

later,
Iceman

Tonio169
Jan 16th, 2000, 01:34 PM
that error means that the object variable "newname" does not exist.

Maartin
Jan 16th, 2000, 03:29 PM
Copy the link below, past it into browser.
When there download the file called junk.exe
When done downloading, double click on it and it well extract itself.

In there is a test project that will demonstrate how to do what i think you are trying to do.
http://www.freedrive.com/ASP/PostFolderShortcut.asp?fsc=2574178

Hope it helps.


------------------
-----------------------
Maartin
dinamite@onwe.co.za
-----------------------

madddog
Jan 17th, 2000, 02:11 AM
Thanks marting the file helped show me the error of my ways.

Mike