+ Reply to Thread
Results 1 to 6 of 6

Create and Mail PDF wont attach PDF (Rondebruin)

  1. #1
    Registered User
    Join Date
    01-05-2014
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question Create and Mail PDF wont attach PDF (Rondebruin)

    I'm currently using the code below to create and save a 2-page PDF to the specific location with file name being that of the value in cell B9. However, when it comes to opening a new mail item and attaching the 2-page PDF just created it will not attach. I'm very limited in my VBA knowledge and have been self teaching myself from forums and YouTube. Any help would be greatly appreciated.


    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create and Mail PDF wont attach PDF (Rondebruin)

    Welcome to the board!

    If the cell doesn't have a file extension, you'll have to add that.
    Please Login or Register  to view this content.
    Last edited by Tinbendr; 02-04-2014 at 03:47 PM. Reason: edit greeting.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    01-05-2014
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Create and Mail PDF wont attach PDF (Rondebruin)

    Hi Tinbendr,

    Thanks for the reply, I added the file extension as shown in your above code with still no luck of the saved PDF file attaching to the newly created email. Is there something I perhaps also need to add to the function coding?

    Please Login or Register  to view this content.
    Thank you,

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create and Mail PDF wont attach PDF (Rondebruin)

    I can't really say without seeing the whole code.

    Whatever filename is generated by Ron's code has to match the filename in .Attachments.Add FileName.

  5. #5
    Registered User
    Join Date
    01-05-2014
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Create and Mail PDF wont attach PDF (Rondebruin)

    Hi Tinbendr,

    Sorry it has taken me a little longer to reply. Please see the whole code below, I have adjusted it with your feedback but still no PDF file being attached in the email. Any further suggestions would be greatly appreciated.

    Thanks!

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Create and Mail PDF wont attach PDF (Rondebruin)

    Nothing is jumping out at me.

    Is the file being created?

    Is it at G:\Confirmation Letters\2014\?

    If the full path and filename being passed to the mail function?

    Can you manually add the attachment?

    Press F8 inside the Print_Confirmation_Email_Local sub and hover over variables along the way to make sure they are being represented properly.

    You can always press Ctrl-G in the editor to turn on the Immediate window. There, you can type, ? Filename, for instance while in break mode to see what the code is generating. You can also put Debug.Print Filename in the code in various places to see what the code is generating. It displays in the Immediate window.

+ 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. How to attach mail Id's to BCC
    By venkatkumar744 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2013, 05:46 AM
  2. click on mail address, print specific page to pdf, attach it to mail
    By Crosplit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2013, 04:54 AM
  3. Combine 2 RonDeBruin macros - Mail+Attachment+Body - Based on value in A Column
    By J0ck3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2013, 03:49 AM
  4. code to attach the draft mail in new compose mail as attachment in outlook 2010
    By priya1987 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 08:38 AM
  5. automatically attach and send by e-mail
    By Simon-ch in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-22-2009, 05:31 AM

Tags for this Thread

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