Modules & VBA :: Send Pdf With Outlook Without Saving Actual File

Oct 13, 2014

I want to send an e-mail with a report as attachment.On the internet i have found two options, and both are not the best solutions.

1. option

Code:
DoCmd.SendObject acSendReport, sReport, acFormatPDF, sMailAdres

With this construction I don't have enough control over the mail, and worse, I get an Outlook message when the mail is sending which I have to answer.

2. option

Code:
Dim oMail As MailItem
Dim oAtt As Attachment

Set oApp = CreateObject("Outlook.application")
Set oMail = oApp.CreateItem(olMailItem)
DoCmd.OpenReport ReportName:=sReport, View:=acViewPreview, WindowMode:=acHidden
Set rpt = Reports(sReport)

[code]...

with this construction I have to enter an existing report.pdf on my filesystem (bold line), but I want to pass the rpt object straight to the mail as an attachment.

View Replies


ADVERTISEMENT

Modules & VBA :: Cannot Set Outlook Send Using Account

Jul 13, 2013

A client wants to e-mail newsletters using a non-default Outlook account. The code below does everything the client needs except setting the SendUsingAccount. In debug I can see that the correct account is assigned, yet all of my testing results in e-mails where the From line is the default account. The test setup uses my own isolated SMTP server, so when I look at the e-mails sent the sender is the default account. The default account's Sent folder shows the sent mail, which is not what we want.

Code:
Sub prepEmail()
Dim frm As Form, startDate As Date, endDate As Date
Dim rs As DAO.Recordset, strSQL As String, intNewsLetter As Integer
Dim rsEmail As DAO.Recordset, rsNewsletters As DAO.Recordset
Dim OlApp As Object, ol As Object
Dim olMail As Object, olAcct, olAcctTemp

[code]...

View 3 Replies View Related

Modules & VBA :: Open Outlook And Send Email

Feb 3, 2014

I'd like a command button to open Outlook and create a new email message with the To and Subject fields already populated with what I want, is there anyway to do this?

View 1 Replies View Related

Modules & VBA :: How To Send A Report Via Outlook 2010

Oct 30, 2014

I have a VBA module in my Access 2010 database that will send a report as a PDF via email to a predetermined email address. the only problem using the docmd.sendobject method is i keep getting a pop up that says "A program is trying to send an e-mail on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date."

I have a windows task set up at the same time each day to open this database which runs an autoexec that creates this report and using my VBA module sends the email. i want it to just send the email without any imput from me. I want automation.

Here is my code that i am using to create and send the email

"Private Sub Report_Activate()
filename = "Name of file" & Format(Me.Date_time_returned "MMDDYY") & ".pdf"
DoCmd.SetWarnings False
DoCmd.SendObject acSendReport, "Name of file", acFormatPDF, "the destination email address goes here",,, "Request completed and sent " & Format(Me.Date_time_returned, "MMDDYY"), "Subject of email goes here", False
DoCmd.SetWarnings True
End Sub"

View 4 Replies View Related

Modules & VBA :: Saving Outlook Attachment

Jun 16, 2013

The below code is intended to:

1. open outlook mail;
2. copy the email details into the database;
3. save the attachment into a E: drive location;
4. move the email to another folder.

1,2 and 4 were working fine until I tries to save the attachment and got stuck on the SaveAs line.

Dim Ola As Outlook.Application
Dim Nsp As Outlook.NameSpace
Dim pf, Inbox, ib, newdest As Outlook.MAPIFolder
Dim msg As Outlook.MailItem
Dim Atts As Outlook.Attachments

[Code] ....

View 6 Replies View Related

Modules & VBA :: Send Email To Outlook Distribution List - To / CC Or BCC Parameters

Jan 4, 2014

Is there a way of doing the above? I have several distribution lists (some >100 recipients) defined in Outlook, and would like to use the Docmd. Send Object command to send messages to one or several of them. I cannot find a way of defining a distribution list as any of the To, Cc or Bcc parameters.

View 2 Replies View Related

Modules & VBA :: Filling Excel Template Cells / Save Then Send On Outlook

Jul 13, 2013

I have the code below which takes information from a form on access and sends it over to the correct place on an excel spreadsheet template. This works fine but I then need it to save and send on outlook.

The issue I am having is that the saved document is not attaching to the e-mail. The subject etc all work fine but the excel spreadsheet just doesn't attach. When I go into the folder I have specified for the document to be saved in it isn't there either. :0(

The code for the e-mail "callmail" function works perfectly for word documents but I don't know if it is different for an excel file.

Code:

Private Sub Command154_Click()
On Error Resume Next
Dim appExcel As Excel.Application
Dim wbook As Excel.Workbook
Dim wsheet As Excel.Worksheet
Set appExcel = New Excel.Application

[Code] .....

View 4 Replies View Related

Modules & VBA :: Send Meeting To Outlook - Address Item Line Causing Error

Mar 24, 2014

I'm trying to have a command button send info on the form straight to Outlook as a meeting. So far, the code below works apart from the address bit. I need the code to automatically add the same 2 email addresses as recepients everytime.

Error message highlights the red line below with the following message:

Runtime error '438'
Object doesn't support this property or method

I'm new to VBA, so don't understand what is wrong here. The reference is set, I've tried different permutations of the "To:" & "Recipients.Add" for the email address with no joy.

Code:
Private Sub cmdSend_Click()
Dim outApp As Object
Set outApp = CreateObject("Outlook.application")
Set outmail = outApp.CreateItem(olappointmentitem)

[Code] .....

View 10 Replies View Related

General :: Send Email 7 Days Before Actual Date

Aug 30, 2013

How can I make that my access send an email to a user if there 7 days until en employee's birthday.

View 5 Replies View Related

Modules & VBA :: MS Access To Open Outlook (MSG) File

Oct 20, 2014

when I open a .msg file using

dim x as long
x = Shell("""C:Program Files (x86)Microsoft OfficeOffice15Outlook.exe"" /f ""D:mymessage.msg""")

how to access the fields "To", "CC", "Subject", "Date", "Body text", etc ?

My problem: I have a lot of files .msg (about 1000) and I want to put them in a single file (preferably in txt).

View 7 Replies View Related

Modules & VBA :: Insert Word File Into Outlook Email Within Access

Jul 8, 2013

I like to do following task using access VBA:

1. Open outlook.
2. Select word file(with tables and graphics) and insert into new outlook email.

View 1 Replies View Related

Modules & VBA :: Remove Special Characters From File Name (when Saving)

Feb 20, 2014

I use the below code as part of a database which creates documents and then saves them using data from the form fields.

Every now and again one of the form fields contains a "special" character such as /,@,& and this prevents the file from saving.

Is there a simple addition to the below code to remove special characters from the file name if there is one present?

It causes all sorts of issues as many people don't realise that there has been a problem until it is too late.

Code:
objWord.ActiveDocument.SaveAs2 FileName:="C:UsersPublic" & Forms![Front Page]![Site 2 Name] _
& " " & Forms![Front Page]![Combo79] & " " & "O2" & ".doc"
objWord.ActiveDocument.Close

View 9 Replies View Related

Modules & VBA :: Exporting To Excel Template And Saving As New File

Jun 25, 2014

Any definitive way of exporting a query to an Excel file and then saving it as a new file without saving over the original.

I've tried to remove any confidential info from the code below so it's not exactly the same.

Code:
Dim XLApp As Excel.Application
Dim XLSheet As Excel.Worksheet
Dim tmpRS As DAO.Recordset
Dim strFolder as String
strFolder = ("C:Profiles"& [Name] & "")

[Code] ....

The error seems to be with the SQL statement although that may just be the first error that it got to. I read that you can't refer to a Query if it has a criteria and that you have to write the SQL directly into the code.

View 13 Replies View Related

Send Object Macro Via Outlook

Dec 23, 2005

Hoping someone can help - need to know if there is a way to use a Outlook message other than the blank one that is used with the send object macro.

Maybe a normal message with a signature, template or something - when the macro is run, no formatting is included with the e-mail message, and the body of the message is limited to 255 charaacters.

Would like to use a customized message, and I need the send object macro to place the object in that message format.

If anyone can help, I would greatly appreciate it...thanks.

View 1 Replies View Related

Forms :: Access Send Email Using Outlook

Mar 13, 2013

I am trying to modify the following code to send an automated e-mail using Microsoft Outlook instead of Lotus Notes. We recently switched e-mail clients and now the older code does not work. I have tried to comment in all areas to indicate where the new Outlook code has been inserted.

Private Sub SendEmail(ByVal Subject As String, ByVal Body As String)
'The bulk of this code for Lotus Notes comes from this website:
Dim copy(100) As Variant
Dim strSQL As String
Dim rsTemp As Recordset
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name

[code]....

View 10 Replies View Related

General :: Send Emails From Run Time Version With And Without Outlook?

Nov 14, 2012

Must Outlook be installed for Access to send emails?

Can I send emails from the Run-Time version of Access? (with and without outlook)

View 1 Replies View Related

Send Details Of Emails In Outlook To Access Database?

Dec 18, 2013

I have a contact form on our website which sends an email to the business dev team saying that the user has requested to be sent product sheets. The email contains the users name, email, phone number, and a few other fields. Is there a way I can send the details of these emails to my access database automatically?

View 9 Replies View Related

Send Automatic Email Upon Receiving A Request In Access Through Outlook

Nov 11, 2014

I'm trying to use Access to send an automatic email reply upon receiving a request from a customer/employee, telling them that their request has been received and this is the tracking number and the due date of service completion. How can I do that? And I want it using Outlook because all the contacts are saved in Outlook and all emails sent and received through Outlook. And the version is Access 2010.

View 3 Replies View Related

General :: Send Outlook Email Based On List Of Emails In Access Query?

Sep 15, 2014

I've setup a selection form that returns a specific list of email addresses in a query.

What I can't work out is how to press a button and have the email addresses populate the To: field in a blank Outlook email - I don't need any bells or whistles.

View 8 Replies View Related

General :: Send A Specific Email From Outlook To All Email Addresses Within A Query

Jan 21, 2014

I have a database that I can use to create a query, grouping companies by city. I then want to send a specific email I have created in outlook to all of the email addresses in the query.I do not need to include names.

View 6 Replies View Related

Saving An MDB File As MDE

Nov 28, 2006

I seem to be having problems saving my database files (.MDB) as .MDE files.

I have a database that only contains data (tables).

A second database is used as the interface to this data (it contains forms, reports, and uses linked tables to the data database).

This secong database file is then copied and used my a few users, so that everyone is accessing the same set of data.

I am trying to save the second database as an .MDE file, but under the Tools, Database Utilities option... 'save Database as an MDE' is never highlighted as a viable option. Is there some trick (or conditions) to enable this option?

I am basically doing this so that I can distribute the MDE version of the interface so that users will have limited / no access to be able to modify the code (or get into the table?).

Thank you for any advice or directions you may be able to pass on.

-arm1

View 4 Replies View Related

General :: Can SendObject Be Used To Send MDB File

Feb 28, 2014

I use SendObject to send automatic emails from my application. Can I attach a table or an MDB file to the email? How do I do that? Or do I attach a table and it sends it as a text file?

View 4 Replies View Related

Send CSV File With A Footer As Last Line

Nov 8, 2012

One of our vendors needs data from a table with a header (as HD) and a footer (as FT). The header is easy but short of converting the query to a report, how do I send CSV file with a footer as the last line.

View 1 Replies View Related

General :: How To Import PST Outlook File

Jan 22, 2013

Is there a way to import a PST outlook file into Access 2010 or 2013. Or is there a Plug-in needed that can do it.

View 3 Replies View Related

Saving New Fonts In The MDB File..

Aug 23, 2005

Hi,

I've recently started working on a new database and already have most of my forms, queries and reports ready. However, I've been using a special font that is not available on most PCs. I was wondering whether it was possible to save the font inside the MDB file so that it can be viewed properly on other systems as well ? (Sort of like in Powerpoint).

Another thing (I guess it's impossible but I'll ask anyway) : Is it possible to save the whole Windows Style design (Scroll Bars, Arrows, Icons, Menu colors, etc..) in my database file ?


Thanks for your help,

Daniel.

View 1 Replies View Related

Saving A Named File

Nov 7, 2006

what is the correct syntax to string in a variable date?

here is my current coding

[CODE]

Set rsDate = CurrentDb.OpenRecordset("qry_Actual_Costs_Thru")

strSOPCDate = rsDate.Fields("Fiscal Week")

'need to string the file name with the date

ActiveWorkbook.SaveAs Filename:= _
"C:my folder locationCombined SOPC THIS IS WHERE I NEED THE strSOPCDate.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

CODE]

my overall goal is to save a weekly file named "Combined SOPC m/dd/yy" where the m/dd/yy is being pull form strSOPC Date whick pulls from my qry.

thanks
Tuk

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved