Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi,
i have a code that prints a range as a jpg, opens outlook and puts it in. What i need it to do is name itself as the filename to which it is created in. Example: c/data/excel/1234 myclient.xls ( file it is to be created in) i would like it to name itself 1234 myclient.jpg it doesnt save anywhere, only as an attachement but it needs a name. i can alter the code and give it a standard name like Quote.jpg but when you send alot to the same person and they save the attachment, they all have the same name so this is why i need the change. Can this be acheived? REgards, Nigel |
#2
![]() |
|||
|
|||
![]()
If you don't save it, you can't name it, as that is how it gets its name.
-- HTH RP (remove nothere from the email address if mailing direct) "Nigel" wrote in message ... Hi, i have a code that prints a range as a jpg, opens outlook and puts it in. What i need it to do is name itself as the filename to which it is created in. Example: c/data/excel/1234 myclient.xls ( file it is to be created in) i would like it to name itself 1234 myclient.jpg it doesnt save anywhere, only as an attachement but it needs a name. i can alter the code and give it a standard name like Quote.jpg but when you send alot to the same person and they save the attachment, they all have the same name so this is why i need the change. Can this be acheived? REgards, Nigel |
#3
![]() |
|||
|
|||
![]()
Hi Bob,
in the code, i put a general name which is the same whatever. Do i have to save it in order to give it a name? Regs, Nigel "Bob Phillips" wrote: If you don't save it, you can't name it, as that is how it gets its name. -- HTH RP (remove nothere from the email address if mailing direct) "Nigel" wrote in message ... Hi, i have a code that prints a range as a jpg, opens outlook and puts it in. What i need it to do is name itself as the filename to which it is created in. Example: c/data/excel/1234 myclient.xls ( file it is to be created in) i would like it to name itself 1234 myclient.jpg it doesnt save anywhere, only as an attachement but it needs a name. i can alter the code and give it a standard name like Quote.jpg but when you send alot to the same person and they save the attachment, they all have the same name so this is why i need the change. Can this be acheived? REgards, Nigel |
#4
![]() |
|||
|
|||
![]()
Nigel,
The attachment is a file on the disk, so youn could rename that just prior to attaching, then rename back. Something like oldFile = "C:\Documents And Settings\Nigel\My Documents\myFile.xls" Application.DisplayAlerts = False NewFile = Left(oldFile, Len (oldFile-3)) Name OldFile as Newfile ' do you Outlook stuff Name NewFile as oldFile Application.DisplayAlerts = True -- HTH RP (remove nothere from the email address if mailing direct) "Nigel" wrote in message ... Hi Bob, in the code, i put a general name which is the same whatever. Do i have to save it in order to give it a name? Regs, Nigel "Bob Phillips" wrote: If you don't save it, you can't name it, as that is how it gets its name. -- HTH RP (remove nothere from the email address if mailing direct) "Nigel" wrote in message ... Hi, i have a code that prints a range as a jpg, opens outlook and puts it in. What i need it to do is name itself as the filename to which it is created in. Example: c/data/excel/1234 myclient.xls ( file it is to be created in) i would like it to name itself 1234 myclient.jpg it doesnt save anywhere, only as an attachement but it needs a name. i can alter the code and give it a standard name like Quote.jpg but when you send alot to the same person and they save the attachment, they all have the same name so this is why i need the change. Can this be acheived? REgards, Nigel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro Formula revision? | Excel Worksheet Functions |