+ Reply to Thread
Results 1 to 26 of 26

Copy email contents to new email whilst saving attachment.

  1. #1
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Copy email contents to new email whilst saving attachment.

    This one I think will be impossible, but I will ask anyway in the hope.
    At work we used to use Windows XP and Office 2003. Previously we would receive emails with attached PDF forms. We could double click the attachment, edit the form, save and then forward or reply with attachment with minimal fuss.
    Now on this "new" system of Windows 7 and Office 2010, this is impossible. The only way we can do this is to save the PDF to some location, open, edit, save, forward and attach to new message. With some emails containing up to 10 PDFS and emails coming in all day, this longer approach is taking forever.

    At the press of the button I would ideally love outlook to:

    Copy contents of email to a new email, with addresses, subject line all intact.
    Auto save attachment to hard drive and re-attach to the new email.
    We could then double click the PDF (in theory we should be able to edit it) edit the pdf, save and then we can send.
    Is any of this possible?

    From what I can see, previously, we doubled clicked the pdf, which opening it in reader 7. Edited the required form fields and hit save, overriding the attachment. Then we would forward it. We wouldn't have to faff about saving to a location and re-attaching it.
    Which seems to be the case with our new setup.
    While I admit the new way of working isn't overly long, when there are dozens of emails to wade through, it does become tiresome.

    The issue is, the work PC's are tightly locked down, the installation/removal of anything is near impossible. I've tried every guide I can find on the net to edit attachments and nothing works.
    The only thing I can use at work is VBA, which hopefully, will help.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi there,

    Perhaps not totally impossible!

    Do you need this to work from within Excel or from within Outlook?

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg, to the rescue again?

    I will explain the workflow that people here take and see if its possible.

    How it used to work:
    • Email arrives, containing a PDF form attachment
    • User double clicked PDF attachment
    • PDF form is opened, edited and saved over original attachment without asking for a new save location. It just did it before,
    • Send email back to person
    • Done


    Our current workflow with new systems:
    • Email arrives, containing a PDF form attachment
    • User double clicked PDF attachment
    • PDF form is opened, edited
    • Hitting save on form causes outlook to ask for a new save location
    • User saves to downloads folder or desktop, wherever.
    • User clicks reply/forward
    • User has to find the downloaded form, attach it to the email
    • Send email back to person


    How I would like it to be:
    • Email arrives, containing a PDF form attachment
    • User clicks magic macro button
    • Email contents, subject line, addressee is copied over to a new email.
    • and/or
    • Attachment is automatically saved in the background to a location and then automatically re-added to email. (If there all multiple attachments on the email, the process would copy them all and re-attach them all)
    • User double clicked PDF attachment
    • PDF form is opened, edited and saved over original attachment without asking for a new save location.
    • Send email back to person


    This process would run entirely in Outlook.

    It would also have to be fire and forget, since most of the people I deal with, would rather speak into a mouse than move it. So a single button to do it all would be ideal, but not required.
    As I said, I don't expect a one click solution to this, as it does seem overly complicated.
    For those wondering what the big deal is, the old way of doing it was easily done in seconds, the new way takes more and with multiple attachments and multiple emails a day, it nearly quadruples the time spent with emails.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    It's funny how the words "will be impossible" can create a reaction

    Ok, I think I've understood what you need - especially that it should work from within Outlook.

    One thing:


    How I would like it to be:
    •Email arrives, containing a PDF form attachment
    •User clicks magic macro button
    •Email contents, subject line, addressee is copied over to a new email.

    The addressee on the incoming email is YOU (or your colleague) - I presume the addressee on the outgoing email should be the sender of the incoming email. Is this correct?

    Best regards,

    Greg M

  5. #5
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Ah yes, my bad.
    In an ideal world, this script would take PDF attachments, but have the option to be tweaked to take excel and/or word docs too. As some people on another floor have similar issues with excel docs too.
    Deleting the attached temp file after sending would be a bonus, but not required. Don't want to make the apes at works life too easy.

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Do you want to copy all attachments to the outgoing email or just the .PDF attachments?

    Regards,

    Greg M

  7. #7
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Is it easy to change later?
    I guess to start with it would just be PDFs.

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Sorry - our last two messages "crossed in the post"

    Ok, to start with I'll try to give you the option of all attachments vs only .PDF attachments. This can probably be refined further if required at a later stage.

    For (my!) simplicity I suggest using a Yes/No Message Box saying "PDF attachments will be copied by default - click on Yes if you want all attachments to be copied (new line) Do you wish to copy all attachments?"

    Regards,

    Greg M

  9. #9
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg.

    That sounds awesome indeed. I am sure the luddites can cope with that!

  10. #10
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Making progress here, but having problems with my own Outlook account, so it's difficult to test 100% - will post something asap.

    Regards,

    Greg M

  11. #11
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    No worries man. I truly appreciate anything you can come up with.

  12. #12
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Insert the following code into a standard VBA CodeModule in Outlook and see if it does what you need:

    Please Login or Register  to view this content.

    You can insert whatever temporary location is appropriate for your own installation.

    I've added the highlighted suffix to the email subject to make it a bit easier to keep track of things while you're testing the code, but obviously it should be removed from the final version.

    Saved versions of attachments are automatically deleted from the temporary storage location once they have been attached to the new email.

    I'm having problems with my own Outlook setup here, so I haven't been able to send the generated email, but apart from that it seems that the generated email contains everything that it should.

    Install it on your own computer first, and run it via the Alt+F8 key. When/If you're satisfied that it does what you need we can discuss the most efficient way of deploying it to, and running it on, the Luddites' computers.

    As always, please keep me informed.

    Best regards,

    Greg M

  13. #13
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg.
    Thanks so much for doing this and helping out.

    I've just tested it and alas, it doesn't override the file. But I think once again that is more of a stupid limitation with the new office.
    It all works, but when I edit the test form and click save, it asks to save it again.
    I've checked the location for the temp file, in my case C:\MS, but nothing appears there when I run the macro. Should it?

  14. #14
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    The temporary files are normally deleted immediately after they have been attached to the new email. To check that the files are actually being created, just "comment out" the following line:

    Please Login or Register  to view this content.
    This will leave the temporary files in place, so you can see if that makes a difference to the way things happen.

    Keep me posted.

    Regards,

    Greg M

  15. #15
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg

    After further testing, I think it shines another light on the issues with the new office.
    The temp file does appear fine, but opening the file in outlook still asks me to save a new copy.
    However, if I open the temp file seperately, it will open and be editable. Only outlook seems to have a problem.
    I even removed the attachment from the newly macro'd message and manually added the PDF. Still won't let me edit it without asking to save to a new location.
    Baffling and infuriating.

  16. #16
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Both baffling AND infuriating

    I'm using Windows 7 and Office 2013 here.

    What happens if you edit the attachment, press "Cancel" when you're asked for a new file location, and then just send the email anyway? Is the unedited version sent, or is it "just" that an edited version is not saved locally?

    Regards,

    Greg M

  17. #17
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    It would seem the edited version is not saved.
    Oddly, if I use the macro, the attachment in the email will be File.pdf. But if I open it up it will say in Acrobat Reader, File(004).pdf. If I try to edit and save, it will want to save it as File(004).pdf.
    so it is getting this number from somewhere and it did it before this macro was used.
    Also, on a side note, the macro now only seems to run if I open VB and click the green play button. I added it to the ribbon before and it worked, but it now does nothing when I click it. But that is a low priority issue.

  18. #18
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Just passing by, so this is a quick reply!

    Outlook and Excel seem to handle security-related issues in different ways.

    In Outlook, select File >> Options >> Trust Center >> Trust Center Settings >> Macro Settings

    Then select "Notifications for all macros", Ok, Ok, etc.

    This should open a Dialog Box when attempting to run a macro from the Ribbon, and you can allow the macro to run.

    Hope this helps.

    Regards,

    Greg M

  19. #19
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,


    It would seem the edited version is not saved.
    If the email is sent with the unsaved file attached, which version of the attachment is received? The edited version? The unedited version?


    Oddly, if I use the macro, the attachment in the email will be File.pdf. But if I open it up it will say in Acrobat Reader, File(004).pdf.
    Is the file the fourth attachment to the incoming email? I don't know if this is significant - it just might explain where the number is coming from. Does Acrobat Reader create File(001) in a similar manner to the way Excel creates Book1?

    Sorry - just questions this time - no answers

    Best regards,

    Greg M

  20. #20
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    I will have to pick this one up at work again tomorrow.
    But for now, the macro settings I can't change. Locked down systems, bleh.

    I will do some thorough testing tomorrow and find the sweet spot on what can be saved and under what conditions.

  21. #21
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg

    after some testing it may appear our efforts might be fruitless.
    What I have done:

    Opened email with PDF, dragged PDF to desktop, hit reply, dragged PDF to attach it, tried to edit the PDF form, still asks for a new location.
    Opened email with PDF, opened PDF attachment, edited, saved. Asked to save to a new location, saved to desktop. Hit reply and re-attached the PDF to the email. Opened that attachment and tried to edit and save, still asks for a new location.

    What what ever dumb reason, outlook refuses to allow me to override PDF files. While I can do this with Excel and word documents.
    I did initially think of making a similar form in excel for them to use, but trying to explain that and change the way they have been working for years is a fools errand.
    I hate to admit it, but I don't think this one can be done.

  22. #22
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Nil desperandum (not yet anyway!)

    I might have another shot in the locker - will try to get back to you later.

    Regards,

    Greg M

  23. #23
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    It looks as if Microsoft's Bright Ideas department got involved in this one

    The best I can do is point you at the following link which provides a workaround, but you might have to grovel to your IT people in order to have it implemented:


    It was an interesting project, but unfortunately there doesn't seem to be a "clean" solution to the problem.

    Best regards,

    Greg M

  24. #24
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    Hi Greg

    It would seem as well as the monkeys at MS changing things, also Adobe are also to blame here.
    The edit message method or forward method doesn't work with these PDF's. I will try at home later and see if it is an issue with the version of reader we are using but I've tried everything to bypass it and nothing can be done. Not even Adobe Acrobat Pro can do anything with the PDF attachment.
    Adobe and Microsoft, from hell's heart I stab at thee.

  25. #25
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Copy email contents to new email whilst saving attachment.

    I think I may have found the problem, but no fix.
    When the attachment is opened, even with your copied one, Outlook will create a temp version in C:\Users\NAME\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\

    On our sytem, anything on the C drive except the desktop, is locked down and needs admin rights to do most things to. I tested this by going to that folder, moving the pdf to the desktop, edit, save fine. Moved it back to the temp folder, opened, edited, saved, couldn't save over.
    Unfortunately, the only way of changing the temp outlook location is to use regedit, which we are obviously not allowed to do, in case we create Skynet by mistake or delete the internet.

    I will keep going at it, but at long as outlook insists of making temp files on that location, I'm screwed.

    Saying this, it might not even be the issue, since I have yet to test this at home. Then again, DOCS and spreadsheets work. ARGH
    Last edited by X82; 08-18-2015 at 08:15 AM.

  26. #26
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Copy email contents to new email whilst saving attachment.

    Hi again,

    Many thanks for all your feedback - I share your frustration!

    I'm pretty much out of ideas at this stage, but if there's anything you think I can help you with, just shout. You can send me a private message if this thread is closed.

    Best regards, and thanks for the challenges!

    Greg M

+ 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. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 07:55 AM
  2. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 07:41 AM
  3. Macro to send email with attachment for each unique email Ids
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2014, 07:12 AM
  4. macro to email attachment - without saving first
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2011, 10:05 AM
  5. email excel file or worksheet as an attachment to multiple email addresses
    By jgeagle5 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 03:40 PM
  6. Saving excel from email attachment (HELP)
    By mattcox180 in forum Excel General
    Replies: 6
    Last Post: 11-19-2006, 08:48 PM
  7. [SOLVED] How do I change the default location when saving Email attachment
    By Bob from Bristol in forum Excel General
    Replies: 1
    Last Post: 12-13-2005, 04:50 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