Save Outlook Attachments In A Dir

Aug 11, 2015

I expand my code as follow (save the attached files from Outlook - after: If Not Err.Number <> 0 Then):

Code:
Option Compare
DatabaseOption Explicit

Private Sub Befehl17_Click()
' ##################### OutlookImport ##################################
Dim db As DAO.Database
Dim rs As DAO.Recordset

[Code] ...

The directory "Unterlagen" allready exist.

So, the definition of the path works (strPath)
the creation of the path wirks (MkDir)

but the SaveAs command did not work, the new directories are empty.

View Replies


ADVERTISEMENT

Modules & VBA :: Email In Outlook With Attachments

Jun 16, 2013

I am making a new database. And I want to confirm that I can do all the following in Access 2007 and how is best to do it.

1) A form where I can define:a unique Email Number starting at 1.
a directory eg "C:UsersPaulDesktop101 - Brick House"
an email address.
a Recipient Name
a Category for the email. Choosing either "Working" or "Complete". This would be part of the email subject.

2) a button which onclick lists all the files in the defined directory to a box on the form.

3) a button which onclick exports a report containing the list of files to PDF. Then attaches a zip of these files and the PDF report to an email in Outlook for revision before sending.

4)In Outlook the subject would be:

"The Directory Name" - "The Category" - "The Email Number"
"101 - Brick House - Working - Email 1"

5)In Outlook the body would simply be the subject of the email followed by the filenames of the 2 attached files, ie the PDF report and the zip.

View 7 Replies View Related

Modules & VBA :: Storing Outlook Attachments And Patch In Table

Jun 13, 2015

Currently, I'm taking my unread emails, storing them in a table then sending any Excel files to a specified folder I've modified some code I found while surfing and it works great but I'd really like to send the attachment name and file path with the email recordset. It's been a long day so maybe it's super simple. Below is my code. Office 2010 Windows 8.1

PHP Code:

Function ReadInbox()
Dim TempRst As DAO.Recordset
Dim OlApp As Outlook.Application
Dim Inbox As Outlook.MAPIFolder
Dim Atmt As Outlook.Attachment
Dim InboxItems As Outlook.Items

[Code] ....

View 1 Replies View Related

Modules & VBA :: Save Attachments From Query?

Feb 2, 2015

The code works only for tables and not query.

Code:

Dim dbs As DAO.Database
Dim rsQuery As DAO.Recordset
Set dbs = CurrentDb
Set rsQuery = dbs.OpenRecordset("myQuery")
Set rsImage = rsQuery.Fields("Images").Value
While Not rsImage.EOF
rsImage.Fields("FileData").SaveToFile "C:UsersmyNameDesktop"
rsImage.MoveNext
Wend

View 2 Replies View Related

Shared Drive Path To Save Attachments

Aug 27, 2014

Saving attachments to shared drive.

I have a order database and i receive invoices from suppliers and there are different users updating the records. I want to save the invoices in shared folder so all of the users can view/access the invoices.

View 3 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 :: Save As Dialog Box - Allow User To Save Copy Of Current Database At Desired Location

Feb 12, 2014

So I have this relatively simple problem: I need to create a button that once clicked will open the Save As dialog box and allow the user to save a copy of the current database where he wishes. The filename should contain todays date in DDMM format along with some pre-set text e.g. DDMM PresetText.

I am using Access 2010.

View 2 Replies View Related

Modules & VBA :: Save Access Report As PDF And Save To Folder

Jan 10, 2014

I have a few selected reports on an Access 2007 database that users can run. Is there a way for users to view the report, save as a PDF and automatically save a copy to a shared drive by modules/vba coding as an On Click event procedure?

View 4 Replies View Related

General :: Open Save File Dialog - Select File From Text Box And Save To Selected Location

Aug 8, 2013

I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !

View 1 Replies View Related

Sending Multiple Attachments

Oct 3, 2005

I have looked through the message board, and cannot find an answer for this question.

I would like to send 2 different reports to the same person, in the same e-mail. Is this possible?

View 1 Replies View Related

Stuck On Mailing Attachments

May 10, 2007

Hi, all!!

I need to generate 1 email with 3 attachments from an Access Db. These attachments are canned reports that are generated each week with fresh data.

I've done several searches and found a lot of good information here. Based on what I've read, I decided to output the 3 reports to a folder in My Documents and then automate Outlook to send the message.

I've used the output function to create the 3 files. No Problem, works well.

Then I found this code for automating Outlook. (Pasted below)
I can get it to work (following either step 7 or step 8 below) but only if I include the attachment path in the SendMessage command.

Assuming the full paths are:
C:My DocumentsReport1.snp
C:My DocumentsReport2.snp
C:My DocumentsReport3.snp

how do I modify the code to automatically attach all 3 files?

Any ideas?
As always, thanks for taking the time to help,
BeckieO


Sub SendMessage(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Henny Penny")
objOutlookRecip.Type = olTo

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

' Set the Subject, Body, and Importance of the message.
.Subject = "This is an Automation test with Microsoft Outlook"
.Body = "Last test - I promise." & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send

End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub


7. To test this procedure, type the following line in the Immediate window, and then press ENTER: SendMessage "C:My DocumentsCustomers.txt"

8. To send the message without specifying an attachment, omit the argument when calling the procedure, as follows:SendMessage

View 3 Replies View Related

Posting Info With MDB Attachments

Jul 6, 2005

Does anyone know why I get Error on Page when I try to attach a sample file to my postings..?

Maybe I do not have authority?


Thanks

Dave P

View 1 Replies View Related

Handling File Attachments

Aug 19, 2005

I have a database for which the user can "attach" supporting files. Currently I handle this by putting a button on the form. The button opens the folder related to the current record via windows explorer. The user is then free to open any file contained, or drag and drop new files if needed. It works reasonably well.

But there is no indication when you look at the form if there are any files attached or not.

First, if anyone can point me to a better way to handle this, (it bugs me that there are thousands of folders being created to each hold a file or two), I would appreciate that. The typical attachment is a message dragged and dropped out of Outlook.

Second, assuming I continue doing things this way, I am thinking I would like to add a listbox to the form. When the form moves to a new record, I would populate the list box with the name of any files found. I know how to do that, but to which event would I be attaching this code?

Thanks,
David

View 1 Replies View Related

How To Work As A Report In The Attachments

Apr 5, 2012

How do I work as a report in the attachments is based on the name of the school / seat number / total

View 2 Replies View Related

Button To Add Attachments To A Table

Jul 30, 2014

I am looking for a way to attach X amount of pictures to a record. I want to use a command button that opens an explorer to choose X amount of files. I don't want to just open a folder because that won't return the file location.

How to open an "attachment explorer"?

Access 2007

View 1 Replies View Related

Add Attachments From Database To Email

Jul 21, 2015

I am trying to find the VBA code that adds attachments currently stored in the database to an email. Currently, I have a button that will email the report refernced on my input form. My attachments are stored in a table, but I have built a query for my attachments that wil filter based off the referenced report on the input form. Below is my VBA code to email a report.

Private Sub Command587_Click()
Dim stReport As String
Dim stWhere As String
Dim stSubject As String
Dim NCRNum As String

[code]...

View 4 Replies View Related

Attachments To Display Their Filenames

Jan 5, 2013

How to view the file names of attached files in Access 2010 using a Web Database, specifically the Contacts Web Database that is a template in Access.

Currently it only shows one PDF icon for all my PDF files. I would like to be able to view the file names of all the PDFs in the attachment field. While I'm certain this can't be done within the same field as the attachment box (though would be nice), I would think it would be possible to populate another field with this information.

I have experimented with different things with no luck using a new standard database for testing purposes. The closest I've come was using the SubForm/SubReport; it actually gave me the values for the attachment... see in the picture below.

But even then, it did not work and gave a error: Invalid Control Property: Control Source

View 9 Replies View Related

Multiple Attachments In Different Records?

Oct 22, 2013

I am creating a database that needs to store a large number of pictures. I have a component that we're working on that needs 100 photos of specific details taken and stored.

I have created two separate tables.

One that includes four fields, ID, Component Number PhotoType and an attachment field.

The second table has ID,Photo Type and in this table I've coded 100 records detailing the photos I need. This is used as a lookup field for the first table.

What I would Like to accomplish from this point is to be able to add 100 fields onto the form for the user to click on the attachment and then save the specific photo that corresponds. How do i edit the control source of the attachment item on the form so that it is specific to one component number, and one phototype?

View 1 Replies View Related

Individual Emails And Attachments From Form

Jul 10, 2005

I'm sure this is here somewhere but I just can't find it.

I have a form where a selection of suppliers are selected, I then want to email each supplier a report attachment - headed up with their particular details - for them to complete and return.

I can use the SendObject to send one email with all reports attached, how do I split it up? Can I split it up?

View 1 Replies View Related

Linking Database Fields To Attachments.

Aug 19, 2004

Hi i am working with a database that contains customer information
and sometimes files and attachments will need to be saved into the
database. I presume i will have to save the attachments somewhere
and then link to them, but i really haven't a clue where to start. Does
anybody have any information about this or even know where i can
look for information!
Thanks in advance!
Treasa

View 2 Replies View Related

Modules & VBA :: How To Send Different Attachments To Different Recipients

Jul 22, 2015

I currently have a code set up which sends an attachment from a drive on my computer to all the email addresses in a certain query. I would like to change the code so that I can add a button that will allow me to send an email with a specific attachment depending on their individual code in a table, e.g each person will receive a specific attachment. At the moment, the attachments are saved with the same file name as the person's specific code.The code I am currently using is:

Private Sub Command9_Click()
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object

[code].....

View 9 Replies View Related

Forms :: Attachments Will Not Show In SubForm

Dec 18, 2013

I have a table called "tblTasks" and the table allows users to attach files to a task they wish to assign to a resource in their respective department. I have based a query on this table that returns the tasks associated with a given resource; however when the resource tries to view the attachment via a Subform - the Subform is based on the query - the attachment field does not yield any understandable results. The query is correct because all of the other data for the tasks show up perfectly; however the attachment, for some reason, is missing.

View 3 Replies View Related

Modules & VBA :: Sending Email With Or Without Attachments

Jan 12, 2015

I'm working on a database for work that email's the current record after the form is completed. I have a attachment field in the table called Photo and some record's have a photo attached and other's don't. The code below works great with records that have a photo attached, but I get a path not found if I try to email a record that does not have a photo. I know that I need to put some form of code to check the photo field for a attachment, but I'm having a brain fade as to just what the code is.

Code:
Private Sub eMail_Report_Click()
Dim oFilesys, oTxtStream As Object
Dim txtHTML As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

[Code] ....

View 5 Replies View Related

Modules & VBA :: Storing Attachments On A Network

Jun 12, 2013

First, I'm developing both the Front End and Back End in Access 2007, and I intend to distribute the application using the Access Run Time. The powers that be will not let me use SQL Server.

The database is required to house attachments. Initially, I had created a separate back end database to store the attachments, but the file would quickly grow beyond the 2GB limit - roughly within 3 weeks. Instead, I decided to save the "attachments" in folders (named after the parent records PK ID) on the network. Using VBA, I would populate a list, based on the parent record, from which the user could select the file, do what needs to be done, then save it.

Unforunately, we're running into data security issues - all of the attachments will have private personal information - SSNs, Loan Numbers, Account Numbers etc., so they need to be stored in a location that's not universally accessible. All of the users have different permissions based on their department, acting as a very basic security level (i.e., Department 1 users will not be able to view any parent records associted with departments 2 or 3).

So I need a way for my back end to take a file located in a separate directory not normally available to the Front End User, then move that file (or save a copy that will be overwritten when re-attached to the record) to a location that IS accessible to my Front End User.

Can I create/use modules stored on the back end?

My first thought is to let the back end store the record in a temporary attachment table that is deleted when the user is done with it, but I've noticed that Access has trouble reclaiming the space when the attachment is ultimately deleted once the user is done using it, and I'll run into my 2GB limit again.

Alternatively, I could create a new .accdb file each time the record's attachments need to be accessed, and then delete that database once it's done and the attachments are returned to the secure location, solving my limit problems.

View 1 Replies View Related

Modules & VBA :: Open Multiple Attachments

Jul 15, 2013

I have a Database with a field that holds several attachments. I want to make a command button for a form that will open the attachment window that pops up when you double click on the attachment in the table. attach_fig7(1).gif.. I'd like the above window to open when I click the command button.

View 3 Replies View Related

Queries :: Records With Attachments In Table?

Feb 6, 2015

I am working with access 2010 and I have a database that has attachments in the table. I have set up a query to in by database but every time I have a record with 2 or more attachments on it it shows that record as two different records in my query. I am wondering if there is a way I can make the query show one record and to be able to view attachments like in the original table.

View 1 Replies View Related







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