Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Reemail
Nadia Wilkes 
    
4 years ago
I have a report that has a button that has vba to send to email that particular report for that designated customer. We are moving the database over to an Amazon cloud based server and it has basically rendered it impossible to send via the button as there is now outlook. IT have given us Print2Email Server that seems to work well when printing, select that printer and an email box opens to send the item. However it doesnt of course auto populate the customer email and or any message text. Is there any vba I can use to achieved the automation still? Thanks
Kevin Yip  @Reply  
     
4 years ago
You can always use the Outlook object in VBA as long as you have Outlook installed on your PC.  Here is a sample code to create an email with recipient, subject, body, etc., and send it.


    ' Create a new MailItem.
    Dim m As Outlook.MailItem
    Set m = Outlook.Application.CreateItem(Outlook.OlItemType.olMailItem)
    
    m.Subject = "test sending attachments"
    m.Body = "Hello World" & vbCr & vbCr

    ' Recipient's e-mail address.
    m.To = "a_friend@whom_i_trust.com"

    ' Create attachment
    Dim a As Outlook.Attachments
    Set a = m.Attachments
            
    ' Attach attachments to email.
    a.Add "C:\My Documents\report1.pdf"
    a.Add "C:\My Documents\report2.pdf"

    ' Display email composition window.
    m.Display

    ' Send email.
    m.Send
Nadia Wilkes OP  @Reply  
    
4 years ago
Thanks Kevin. Our IT Company are setting up the access program on a Amazon server and I believe the problem is that it is just the access program that goes on there. No outlook so no outlook profile against the user. They have set up the Print2Email Server software so they can print to that which opens a generic looking email to send but of course there is no auto populating of things like the customers email and body text. Any ideas on that one? Thanks Nadia
Kevin Yip  @Reply  
     
4 years ago
You use Outlook on *your* PC, not on the server.  Outlook is not designed for servers anyway.  If you have Outlook installed on your PC, and your PC has a way to connect to your cloud database and pull data from it, my code above should work.  For instance, if your database tables contain your contacts' email addresses, you can pull them out to compose emails with such code.  Outlook has to be already configured to send/receive email properly first.  You can use any email provider with Outlook.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/8/2026 8:11:57 PM. PLT: 1s