Results 1 to 2 of 2
  1. #1
    MelonFuel is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    28

    Add email to this piece of code

    Hi




    Just some quick questions how could i add an email function to the code on another button on the report.


    Code:
    Private Sub CreatePDF_Click()
    
    
    Dim strFileName  As String
    Dim strDocName As String
        
        strFileName = "G:\Word Documents\ORDERS\" & Me.OrderID & ".pdf"
        strDocName = Me.Name
        
        DoCmd.Close acReport, strDocName
        DoCmd.OpenReport strDocName, acViewPreview, , , acHidden, -1
        DoCmd.OutputTo acOutputReport, strDocName, acFormatPDF, strFileName, True
        DoCmd.Close acReport, strDocName
    
    
    End Sub

    This code is on a button on a report.

    This is what i would like to achieve with outlook.


    1: get the newly saved document ( i.e. C10000 ) as an attachment in the email.


    2: Send the email to one or more clients.


    3: Include information from text fields ( i.e. OrderID, Seller Name, Address )


    4: Bring up the main program (so Basically don't send it).


    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,676
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-23-2012, 12:08 PM
  2. smtp email code
    By alyon in forum Access
    Replies: 2
    Last Post: 05-15-2012, 07:42 AM
  3. NO minimize button in Email Code
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-03-2012, 08:11 PM
  4. Replies: 1
    Last Post: 10-20-2009, 02:05 PM
  5. VB code for sending email through Option Group?
    By getdpt in forum Programming
    Replies: 0
    Last Post: 08-23-2009, 03:59 PM

Posting Permissions

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