Results 1 to 6 of 6
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    To: field revealing e-mail address and fax (2002 SP-2)

    Outlook novice (please be gentle) <img src=/S/please.gif border=0 alt=please width=31 height=23>

    I am using an Access DoCmd.SendOject to send a report (strRecipient = CustomerName). The problem I am having is that when Outlook opens (blnEditMail) the new send it is trying to distinguish the e-mail address from the fax number for the customer. In reviewing the addresses I see that there is an entry for both the e-mail and fax (if a fax number exists for that name). I don't need to have Outlook address the fax issue, so is there some way to prevent duplicate displays (e-mail and fax) from appearing in the To: field? (aside from removing the fax number entry for the contact).

    All input appreciated.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: To: field revealing e-mail address and fax (2002 SP-2)

    I think if you run

    Recipients.Add = strRecipient
    Recipients.ResolveAll

    it should resolve them to their e-mail addresses. See the Outlook VBA Help for ResolveAll, which also shows some basic errorhandling. If you could provide more detail, including your relevant code and the source for your recipient name(s), we can perhaps be more helpful.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: To: field revealing e-mail address and fax (2002 SP-2)

    John:

    Thanks for the reply. I'm not certain I follow where exactly you're suggesting I place your code amendment. The Access code for the form the e-mail is sent from is as follows:

    Private Sub ComboOrderConfirmEmailCust_LostFocus()
    On Error GoTo ErrHandler
    'E-mail order confirmation to customer

    Dim strReportName As String
    Dim strRecipient As String
    Dim strSubject As String
    Dim strMessage As String
    Dim blnEditMail As Boolean

    strReportName = "rptOrderConfirmSingleEmail"
    strRecipient = Me.OrderedBy
    strSubject = "Order Confirmation for Rel# " & Me.Release1NoText & Me.Release2NoText
    strMessage = "This is to CONFIRM the above referenced order scheduled to load " & Me.ShCondate1 & _
    " for delivery on " & Me.ShCondate2 & " going to " & Me.ShipperConsignee2 & _
    " in " & Me.ShConCity2 & ". If the information provided here is sufficient there is no need to open the attachment." _
    & vbCrLf & vbCrLf & "Thank you for your order," & vbCrLf & "Bryan"
    blnEditMail = True

    DoCmd.SendObject acSendReport, strReportName, acFormatSNP, strRecipient, , , strSubject, strMessage, blnEditMail
    Exit Sub

    ErrHandler:
    If Err.Number = 2501 Then
    'E-mail cancelled - just ignore error
    Else
    'Other error - inform user
    End If
    End Sub

    How do you open VBA in Outlook? (...told you I was a novice).
    As an aside, might you also know how to "paste" code into a thread without loosing the formating?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: To: field revealing e-mail address and fax (2002 SP-2)

    John:

    I believe I may have stumbled across the answer.
    strRecipient = Me.OrderedBy is the persons name rather than their e-mail address. Outlook is doing the best it can to locate that name, but what it is looking in is the Contacts folder under e-mail address - not the persons name. I can get Access to display the e-mail address in a separate txtbx so that the Me statement reflects the address rather than the name. Will post back. (Still curious about the other questions though).
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: To: field revealing e-mail address and fax (2002 SP-2)

    Problem is I don't know Access at all. If you instantiate Outlook, then you can create a MessageItem, add your report as an Attachment, set Subject and Recipients, and use the ResolveAll Method, you should be able to run it. Search for Access threads showing how to do this, such as <!post=this,281771>this<!/post>.
    -John ... I float in liquid gardens
    UTC -7ąDS

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: To: field revealing e-mail address and fax (2002 SP-2)

    The short answer is to populate the Recipient field with a valid e-mail address, "me@domain.com", but does your database have it? There may also be an Access Application level method to pop up the Outlook Address Book without instantiating Outlook, but I don't know Access, and poking about in the Access Immediates Window I don't see one.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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