Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Okay, so you want to save the file first, then retrieve it as attachment to email. Check this thread that shows how to send email with attachment of existing file. http://forums.aspfree.com/microsoft-...ro-447084.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,

    I went through the link but could not understand it. Just needed to check as to whether it will work on click of a button, as it is not working. Also since multiple files will be saved in that folder, how this code will work to select the particular file I wish to send.

    I think I was not clear in my query, I just want the same file to be mailed and saved, even if it is in a single code and available with a single button. Only a message box before mail comes would come asking for do you wish to send mail, if user clicks yes, than it will attach that file otherwise simply save it.


    I know its getting a little messy, but you have been really helpful in all my queries. Kindly let me know in case it is even possible to achieve this.

    Thanks a lot.

    Aman

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What is it you don't understand? What is not working - error message, nothing, wrong results?

    Determining the specific file to send would be by input to the procedure. Where the code shows ("path\filename") you could put a reference to a textbox that has the file name as provided by the user. The 'path' could be a fixed value or could also be supplied by user.

    .Attachments.add ("C:\Reports\" & Me.textboxname)

    As for the message, after saving the pdf:

    If MsgBox("Send email with attached report?", vbYesNo) = vbYes Then
    'code to send email
    End If

    All can be done with one button click procedure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,

    I tried it and now it is showing an error " Outlook does not recognize one or more names". I dont know where the problem is as I am using same naming convention for the file saved and file to be mailed.

    Aman

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Post your entire procedure and/or the database. Does it error on the save or the mail?

    I know this code works, it is from my project.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,

    I kept on trying, making some modification here and there and it worked. Being a non technical person I was amazed by the way it worked. Awesome was the word that came from my mouth. I could not stop thanking you again and again.

    It automatically sends mail and saves it in sent items. However it does not show outlook and the mail. That is one area where I could not work. This would be my last query in relation to this post:

    Can I see the mail that is being sent before it starts sending it.


    Anyways Thanks a lot. You have made me understand complex technical issues with ease. I am from finance background and had never done any coding prior to this project.


    God Bless.


    Aman

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This code is intended to completely automate sending email. That's what I was after. What happens if you comment out the .Send line? Does Outlook open with the email all ready to go? If so, user will have to click Send on Outlook. Or have user respond to a MsgBox asking if they want to send or cancel. Either way, user must click something to continue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #23
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    What portion shall I remove. Only .send?

  9. #24
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Put an apostrophe at beginning of line to comment it. This will not remove the line but it won't execute as code. And yes, just that one line.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #25
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    I did something like this:

    '.Attachments.Add "D:\VendorReport\" & Me.Text6.Value & "VR.pdf"

    its not opening and now not sending the mail as well.

  11. #26
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Wrong line. Just the .send line.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #27
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Changed to this:

    .Attachments.Add "D:\VendorReport\" & Me.Text6.Value & "VR.pdf"
    '.send

    Still not opening.

  13. #28
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yeah, I just did a test and Outlook does not show. So the code runs in background.

    Just found something.
    Add this just before the '.send line:
    .Display
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #29
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hurray.It works. Finally its working as desired.

    Thanks once again. I will perform the entire process tomorrow from start till end and will update you.

    Thanks a lot.



    Aman

  15. #30
    amangupts is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    43
    Hi,


    I ran the complete process on another system and it worked great.


    Thanks a lot for all the help.

    Aman

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report Generation
    By Lorlai in forum Reports
    Replies: 5
    Last Post: 07-01-2011, 11:13 AM
  2. Automate Number Generation
    By Kero in forum Access
    Replies: 5
    Last Post: 04-28-2011, 01:49 PM
  3. Replies: 3
    Last Post: 02-22-2011, 01:28 PM
  4. Password generation does not seem random
    By ducecoop in forum Access
    Replies: 6
    Last Post: 11-15-2010, 02:37 PM
  5. Automatic Report Generation - Access VBA
    By initiator in forum Programming
    Replies: 2
    Last Post: 04-19-2010, 05:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums