Results 1 to 10 of 10
  1. #1
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25

    Access Product Bolt on (Email System)options

    Hi Guys bit of a wild stab in the dark


    I can create emails, attachments etc

    but I have been asked is there a way or product that will file the email automatically ..
    So I am in a reference (12345) there will be a folder XX\12345 \ and they want the email after it has been sent to be filed in this folder automatically with some form of data stamp ...

    is this a pipe dream ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    similar to:

    useage:
    dim vFilePath

    vFilePath = "c:\folder\file.pdf"
    Email1 "cXavier@aol.com", "your file","here is your file",vFilePath


    Code:
    '-------
    'YOU MUST ADD THE OUTLOOK APP IN REFERENCES!!!   checkmark MICROSOFT OUTLOOK OBJECT LIBRARY in the vbE menu, Tools, References
    '-------
    Code:
    Public Function Email1(ByVal pvTo, ByVal pvSubj, ByVal pvBody, optional pvFile) As Boolean
    Dim oApp As Outlook.Application
    Dim oMail As Outlook.MailItem
    On Error GoTo ErrMail
    Set oApp = CreateObject("Outlook.Application")
    Set oMail = oApp.CreateItem(olMailItem)
    With oMail
        .To = pvTo
        .Subject = pvSubj
        .Body = pvBody
        If Not IsMissing(pvFile) Then .Attachments.Add pvFile, olByValue, 1
        
        .Send
    End With
    Email1 = True
    Set oMail = Nothing
    Set oApp = Nothing
    Exit Function
    

  3. #3
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    Hello, this looks interesting.
    do you have a little demo /sample of this

  4. #4
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi Gary

    You can use the following ONClick Event :-

    Code:
    Private Sub cmdEMail_Click()
     
    10        On Error GoTo cmdEMail_Click_Error
              
    20            If Me.Dirty Then Me.Dirty = False
    30      MsgBox "A Copy of the PDF will be saved to the C Drive PDF Folder", vbInformation
          Dim strSQL As String
          Dim OutApp As Object
          Dim OutMail As Object
          Dim strToSQL As String
          Dim strSubject As String
          Dim strMessage As String
          Dim strReportname As String
          Dim strWhere As String
          Dim strPath As String
     
    40    strToSQL = Me.txtTo
    50    strSubject = "Quality"
    80    strReportname = "rptConcerns"
    90    strPath = "C:\PDF Reports\" & strReportname & ".pdf"
     
    100   DoCmd.OpenReport strReportname, acPreview, "", "[CaseReportedID]=[Forms]![frmEditCases]![frmEditCurrentAuditorCasesSubform].[Form]![CaseReportedID]"
     
    110   DoCmd.OutputTo acOutputReport, strReportname, acFormatPDF, "C:\PDF Reports\" & Format(Date, "mmddyyyy") & _
                   strReportname & ".pdf", False
                  
    120   strMessage = "Find attached the current list of Concerns"
     
    130   Set OutApp = CreateObject("Outlook.Application")
    140   Set OutMail = OutApp.CreateItem(0)
     
    150   On Error Resume Next
     
    160   With OutMail
    170   .To = strToSQL
    190     .Subject = strSubject
    200     .Attachments.Add strPath
    210     .Body = strMessage
    220       .Display
    230   End With
     
    240   On Error Resume Next
     
    290       On Error GoTo 0
    300       Exit Sub
     
    cmdEMail_Click_Error:
     
    310       MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdEMail_Click, line " & Erl & "."
     
    End Sub

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Can you please clarify if you want to file the attachment or the actual email message itself, which I think would involve automating Outlook (assuming that is your email client) to move the email message from the Sent folder to an Outlook folder 12345. Or alternatively save the sent message as a .msg file on a network folder 12345.

    All are doable from Access but they involve different VBA code.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    wow lost my response I must of hit the wrong button

    save a copy of the sent email into network folder <
    Or alternatively save the sent message as a .msg file on a network folder 12345.

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Have a look at these:
    https://www.access-programmers.co.uk...-drive.303925/
    https://www.slipstick.com/developer/code-samples/save-selected-message-file/

    There are many more discussions on this, the idea is to identify the message in the Sent folder (using a specific combination of keywords/date) and saving it as .msg in the netwrok folder of your choice.

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    Quote Originally Posted by Gicu View Post
    Have a look at these:
    https://www.access-programmers.co.uk...-drive.303925/
    https://www.slipstick.com/developer/code-samples/save-selected-message-file/

    There are many more discussions on this, the idea is to identify the message in the Sent folder (using a specific combination of keywords/date) and saving it as .msg in the netwrok folder of your choice.

    Cheers,
    Vlad
    Thats great I will investigate this, as this is exactly what I am after.

    I know the end users what it to do magic... , but this makes sense
    For anyone else out there who reads this -
    effectively the link show how to select an email and then store in a network folder -

    in my case that would be reference 12345 record and it has a network folder 12345 so it can be tweaked to open up this folder when i select emails to store , then data stamps them so that they are in order ,
    then when I send an email from 12346 same thing but folder to open 12346

    Vlad- many thanks for pointing me towards this -much appreciated Qdos to you .
    Gary
    (now to get it to work !!)

  9. #9
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    You're very welcome Gary, post back if you get stuck!

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  10. #10
    GaryPanicZ is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    May 2020
    Posts
    25
    Ok this needs a little polish with some instructions as it’s a little “bland”
    I would suggest adding message box on the on click button –
    “Have you selected the files you wish to copy “
    Yes /No

    Private Sub copyEmailsZ_Click() * button to actual copy

    SaveMessageAsMsg

    “Message your emails have been copied “
    End Sub
    I will also be tweaking the folder to save in to a reference on the record/form I am on
    (I did think this was going to be a bit of a nightmare – but as a simple no frills solution it works -I am sure there are sexier solutions but it does exactly what is say it does )

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

Similar Threads

  1. Build a system generated email
    By Woodmansterne_Ralph in forum Access
    Replies: 3
    Last Post: 01-11-2017, 03:22 AM
  2. Replies: 6
    Last Post: 02-28-2015, 11:57 AM
  3. Replies: 2
    Last Post: 08-14-2014, 11:49 AM
  4. Issues in Create Email Options : Access
    By shwetasabne in forum Import/Export Data
    Replies: 1
    Last Post: 06-30-2011, 08:35 AM
  5. Contacts Database and Email system
    By steve1978 in forum Access
    Replies: 1
    Last Post: 02-16-2011, 09:42 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