Consulting

Results 1 to 3 of 3

Thread: Solved: How to add field in mail before sending !

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Location
    Latvia; Germany
    Posts
    19
    Location

    Solved: How to add field in mail before sending !

    Hello all! If anybodu know the way's to add field to letter before sending?
    In another words - if it posible to add field like this:

    myItem.UserProperties.Add("Number", olText).Value = "123"

    to this mail, before send it:

    Sub SendAttach(strAddress As String, strCCAddress As String, strSubject As String, strMsg As String)
    Dim objOutlk 'Outlook
    Dim objMail 'Email item
    'Dim strMsg
    Const olMailItem = 0
    'Create a new message
    Set objOutlk = CreateObject("Outlook.Application")
    Set objMail = objOutlk.CreateItem(olMailItem)
    objMail.To = strAddress
    objMail.CC = strCCAddress
    objMail.Subject = strSubject
    'Add the body
    objMail.Body = strMsg
    objMail.Send
    Set objMail = Nothing
    Set objOutlk = Nothing
    End Sub

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by separator
    Hello all! If anybodu know the way's to add field to letter before sending?
    In another words - if it posible to add field like this:

    myItem.UserProperties.Add("Number", olText).Value = "123"
    As simple as?

    [VBA]Sub SendAttach(strAddress As String, strCCAddress As String, strSubject As String, strMsg As String)
    Dim objOutlk 'Outlook
    Dim objMail 'Email item
    'Dim strMsg
    Const olMailItem = 0
    Const olText = 1
    'Create a new message
    Set objOutlk = CreateObject("Outlook.Application")
    Set objMail = objOutlk.CreateItem(olMailItem)
    objMail.To = strAddress
    objMail.UserProperties.Add("Number", olText).Value = "123"
    objMail.CC = strCCAddress
    objMail.Subject = strSubject
    'Add the body
    objMail.Body = strMsg
    objMail.display
    Set objMail = Nothing
    Set objOutlk = Nothing
    End Sub[/VBA]

  3. #3
    VBAX Regular
    Joined
    Mar 2005
    Location
    Latvia; Germany
    Posts
    19
    Location
    Thanx xld!

Posting Permissions

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