+ Reply to Thread
Results 1 to 3 of 3

Rename file automatically attached to new Outlook Message

  1. #1
    Forum Contributor
    Join Date
    12-14-2017
    Location
    birmingham, england
    MS-Off Ver
    2016
    Posts
    102

    Rename file automatically attached to new Outlook Message

    Hey!

    I have a sheet that a branch of the company i work for fills out everyday, regarding sales and once finished, sends this sheet to various parties via outlook.

    I have all of the code to do all of that process, which is awesome, but i was wondering if when the file attaches itself to the new message, i could rename the file as something else.

    The part i can see that makes the attachment is below, but i was wondering if, where it says "FullName" that could be changed to something else, like the date for example.

    Please Login or Register  to view this content.
    Cheers

  2. #2
    Forum Guru
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Rename file automatically attached to new Outlook Message

    Hi marcosis,

    You might want to try something like the following:
    a. ActiveWorkbook.SaveCopyAs See: https://docs.microsoft.com/en-us/off...ook.savecopyas
    b. Add the attachment
    c. Delete the copied file: Kill sPathAndFileName

    Lewis

  3. #3
    Forum Contributor
    Join Date
    12-14-2017
    Location
    birmingham, england
    MS-Off Ver
    2016
    Posts
    102
    Hey,

    Thanks for that. I figured it out, but I didn't know about the kill function, so that helps alot!

    Cheers

    Quote Originally Posted by LJMetzger View Post
    Hi marcosis,

    You might want to try something like the following:
    a. ActiveWorkbook.SaveCopyAs See: https://docs.microsoft.com/en-us/off...ook.savecopyas
    b. Add the attachment
    c. Delete the copied file: Kill sPathAndFileName

    Lewis

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Respond email using Outlook based in data in Range A9 (from attached file)
    By fabian_76 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-11-2018, 05:18 PM
  2. [SOLVED] Macro to automatically save a file and display message of path of file
    By robertguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2018, 04:40 AM
  3. [SOLVED] VBA Email two different ranges to outlook (File and Code Attached)
    By JChesney in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-17-2015, 12:11 PM
  4. copy data from outlook attached excel file into a local one
    By s_samira_21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2014, 03:36 PM
  5. [SOLVED] VBA to Automatically Allow/Ignore Microsoft Outlook Message When Executing Macro from Exce
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2014, 06:00 PM
  6. Want a input box to make a copy of master file and rename it automatically
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2014, 02:39 AM
  7. Need outlook macro to copy contents of a attached xls file
    By rajkumarmp in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2013, 10:16 PM

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