Saveas Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top