Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Sep 2002
    Location
    Gainesville, Florida
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    data type problem (2002)

    I have module sub -routine to send a e-mail from a form using outlook as the e-mail program. I pass it the to field, the subject and body, from various forms for example one form might be to accounting about arriving COD shipments , or to engineering about a certain type of failure, you get the idea. my problem is when I try to send a hyperlink., the module takes string data and outlook keeps it that way. does anyone know how to make it turn back into a hyperlink in the body of the outlook message?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: data type problem (2002)

    Are you using DoCmd.SendObject, or do you use Automation to control Outlook in code?

  3. #3
    Lounger
    Join Date
    Sep 2002
    Location
    Gainesville, Florida
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data type problem (2002)

    I am using some sample code I adapted from a KB entry. I send different strings from various forms

    Sub SendMessage(DisplayMsg As Boolean, txtTo As String, txtMessage As String, txtSubject As String)
    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem
    Dim objOutlookRecip As Outlook.Recipient
    Dim objOutlookAttach As Outlook.Attachment

    ' Create the Outlook session.
    Set objOutlook = CreateObject("Outlook.Application")

    ' Create the message.
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

    With objOutlookMsg
    ' Add the To recipient(s) to the message.
    Set objOutlookRecip = .Recipients.Add(txtTo)
    objOutlookRecip.Type = olTo


    ' Set the Subject, Body, importance of the message.
    .Subject = txtSubject
    .Body = txtMessage
    .Importance = olImportanceNormal 'Normal

    ' Resolve each Recipient's name.
    For Each objOutlookRecip In .Recipients
    objOutlookRecip.Resolve
    Next

    ' display the message before sending?
    If DisplayMsg Then
    .Display
    Else
    .Save
    .Send
    End If
    End With
    Set objOutlook = Nothing
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: data type problem (2002)

    If I use your code, and pass a string such as the following in the txtMessage argument, the e-mail address and the URL are converted to links automatically:

    "Send a reply to mailto:loungeadmin@wopr.com and take a look at http://www.wopr.com."

    The mailto: and http:// are essential here, without them, they are not converted to links.

  5. #5
    Lounger
    Join Date
    Sep 2002
    Location
    Gainesville, Florida
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: data type problem (2002)

    I have been doing that, Thanks for verifing, It appears the problem is not my code but a company policy of running outlook in Rich text , when I change to html everything works.

Posting Permissions

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