+ Reply to Thread
Results 1 to 4 of 4

Saveas Macro

  1. #1
    Nigel
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: Saveas Macro

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Nigel
    Guest

    Re: Saveas Macro

    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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #4
    Bob Phillips
    Guest

    Re: Saveas Macro

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1