Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    23

    Unanswered: Save email attachment from Access

    Below is a snipet but the problem is that it won't set my Attachment. It leaves it blank. All I need to do is save the same email attachment to a folder everyday. Thanks


    Set myitem = myOLApp.ActiveInspector.CurrentItem
    Set myAttachments = myitem.Attachments

    x = 1
    Do Until x = 1
    With myAttachments.Item(x)
    If .Filename Like "Daily Mortgage*" Then
    myAttachments.Item(x).SaveAsFile "I:\Op Reporting\Doc Mgmt Reports\Mortgage Reports\Mortgage " & Format(Date, "mmddyy") & ".xls"
    ElseIf .Filename Like "qryExcep*" Then
    myAttachments.Item(x).SaveAsFile "I:\Op Reporting\Doc Mgmt Reports\Mortgage Reports\HOA Exception Reports\Exception Data File\Exception " & Format(Date, "mmddyy") & ".xls"
    End If
    x = x + 1
    End With
    Loop

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    x = 1
    Do Until x = 1
    ...
    X=X+1
    Loop


    how many times will this loop?

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Sep 2005
    Posts
    23
    There is only one Excel workbook attachment with 2 sheets so I guess just once? Someone else wrote that so I don't know the thought process behind it.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by izyrider
    x = 1
    Do Until x = 1
    ...
    X=X+1
    Loop


    how many times will this loop?

    izy
    Interesting question ... My guess 0 times ... And only because the conditional is at the top of the loop and you're at the exit target ... Unless banking on undoc'd behaviour ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •