473,414 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How do I make an email with attachments go to the Outlook instead of popping up?

anoble1
245 128KB
I have some code that picks up some attachments and places them in an email. When I run the code it ends up being about 22 emails.
Anyway, is there a way instead of when the code gets done it will go straight to the Outlook and wait there? Right now it pops up right when it gets done with each section.

Expand|Select|Wrap|Line Numbers
  1. i = 177
  2.         cmbPSSR.Value = i
  3.             DoCmd.OutputTo acOutputReport, "rptCommissionStatement", "PDFFormat(*.pdf)", "C:\Users\anoble\Documents\Parts Counter Bonus\Test\177-rptCommissionStatement.pdf", False
  4.             DoCmd.OutputTo acOutputReport, "rptPSSRMonthlyPartsbyPSSR", "PDFFormat(*.pdf)", "C:\Users\anoble\Documents\Parts Counter Bonus\Test\177-rptPSSRMonthlyPartsbyPSSR.pdf", False
  5.  
  6.                 Set MyOutlook = New Outlook.Application
  7.                 Set MyMail = MyOutlook.CreateItem(olMailItem)
  8.                 MyMail.Attachments.Add "C:\Users\anoble\Documents\Parts Counter Bonus\Test\177-rptPSSRMonthlyPartsbyPSSR.pdf"
  9.                 MyMail.Attachments.Add "C:\Users\anoble\Documents\Parts Counter Bonus\Test\177-rptCommissionStatement.pdf"
  10.                 MyMail.To = "asdf@.com"
  11.  
  12.                 MyMail.Display
  13.                 Set MyMail = Nothing
  14.                 Set MyOutlook = Nothing
Mar 14 '16 #1
1 724
jforbes
1,107 Expert 1GB
I haven't used Outlook automation much, so there maybe some options specific to Oulook to hide and show it's objects.

But a basic option you have is to create an Array to stuff all the MyMail Objects into for Line 12, instead of calling MyMail.Display. Then after all the Mail Objects have been created, you could loop through the Array and .Display them.
Mar 14 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John | last post by:
Hi I am trying to find the way to create an email in outlook. I am using the code given at the end. It works fine the first time but calling the code second time gives the following error; ...
2
by: David Veeneman | last post by:
My web app creates several temporary files, then attaches them to an email that it sends out. When the app attches the documents to the email, .NET locks the files. My problem is that they aren't...
0
by: jackiewkc | last post by:
Hi, Does anyone know how to use VB to write a simple MAPI to save email attachments from a specified email address to my hard drive? What I basically want is that everytime when I receive an...
3
by: olafmol | last post by:
Hello, i want to write a PHP4 script that reads POP3 or IMAP mail and can decode the possible attachments in the email. I've looked around for some classes to do this, and found a few, but most...
6
by: Tim Marshall | last post by:
I am having one HELL of a time with sending pdfs that I generate. Outlook is not my preferred mail client but I have the wrethced thing installed so that I can use some late binding technique I...
2
by: =?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?= | last post by:
In my vb.net 2005 app ...I'm sending email via Outlook 2003. How do I eliminate that annoying outlook box when sending the email. Thanks
0
by: =?Utf-8?B?amVhbm9mbWlubmVhcG9saXM=?= | last post by:
I am having problems opening email attachments when I receive as a Notepad. I have this problem in AOL or Outlook. When I open I get a box with letters, symbols and numbers. I have been told as...
1
by: rottmanj | last post by:
So after a few hours of playing with my config file, I think I have it to a point where I am ready to start adding in the rest of the components to my perl application. One thing that I know I need...
10
by: Corwin Moyne | last post by:
Hi there. I'm a complete noob when it comes to VBA. I have some code that I got online to send an email using Outlook through Access 2010. The code works by displaying an Outlook message window, but...
1
by: varunmaggo | last post by:
I have outlook 2007 and i am building a plugin, that will edit the footer for all the email attachments,(for example - abc confidential). How can i write an outlook addin, that will on the fly, will...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.