Results 1 to 4 of 4

Thread: email promt

  1. #1
    Join Date
    Aug 2004
    Posts
    178

    Unanswered: email promt

    i have to send an email i would like it to alow me to pick from my contacts who its going to can any one help

    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem
    Dim objOutlookRecip As Outlook.recipient
    Dim objOutlookAttach As Outlook.Attachment

    Set objOutlook = CreateObject("Outlook.Application")

    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

    With objOutlookMsg


    'objOutlookRecip.Type = olTo

    ' Add the CC recipient(s) to the message.
    'Set objOutlookRecip = .Recipients.Add("")
    'objOutlookRecip.Type = olCC

    .Subject = "End of week report for week starting " & Forms![frmreports]![Text4]
    .Body = ""

    Set objOutlookAttach = .Attachments.Add("T:\reports\End of week Film report.pdf")


    .Send


    End With

    Set objOutlookMsg = Nothing
    Set objOutlook = Nothing

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I made an email example in the code bank you may want to take a look at: http://www.dbforums.com/showpost.php...2&postcount=46

    and another:

    http://www.dbforums.com/showpost.php...9&postcount=27 (3rd example (SearchFormMultipleWaysHighlightCurrRecNewVersion. zip) and the 2nd Search form in that example - which shows how to quickly find email addresses and send an email.

    I hope those help.
    Last edited by pkstormy; 06-29-08 at 01:35.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Aug 2004
    Posts
    178
    the methods in you post dont add my attachment which is my report convert to pdf which i want to send and pick the person in my outlook contacts because some times the report has to got some else

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    That wouldn't be difficult to add. I'm using the sendobject command which has a parameter to attach reports. In another example, I have an importing routine which shows how to utilize a browse button and find and attach a file which could be combined with the method in my example to attach a file to send out. The code bank has many examples which can be combined together to do whatever you need.

    You might want to download and try some of the examples and pick out things you like. Then it's just a matter of combining the things you like into your mdb together which isn't too difficult. There's code in the code bank to do all sorts of different tasks.
    Last edited by pkstormy; 06-29-08 at 21:10.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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