#1   Report Post  
Nigel
 
Posts: n/a
Default Saveas Macro

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Nigel
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
automatic macro update boconnell Excel Worksheet Functions 4 February 9th 05 07:10 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"