Forms :: SendObject Email Not In Sent Folder
Jun 2, 2013
I am sending an email using SendObject, like this:
DoCmd.SendObject acSendNoObject, , , eMailAddress, ccAddress, , Me.Subject, Me.MessageBody, 0
The email is sent correctly. However, in Access 2003 a copy was posted to the Outlook 'Sent' folder. Since we have moved to Outlook 2010, a copy is no longer posted to the 'Sent' folder. We miss having that copy.
Is there an option that I can set to post the email to the user's 'Sent' folder? If not, what about a BCC? How can I get the user's email address?
View Replies
ADVERTISEMENT
Dec 14, 2004
The code below works for the one email address "Quality Assurance"...but I want to add more email values to SendObject command.
If I do this: stEmail = Me.Quality_Assurance_Authorizer.Column(1) And Me.Engineering_Authorizer.Column(1)..... I get a Runtime error '13' Type mismatch. Is there another way of including a series of email values into the SendObject code below? The reason I'm using the value of the column is that sometimes the value may be null if that department doesnt need to be emailed. Thanks for any help.
Private Sub cmdPCAuthSend_Click()
Dim stDocName As String
Dim stEmail As String
stDocName = "rptPCAuthReq"
stEmail = Me.Quality_Assurance_Authorizer.Column(1)
DoCmd.SendObject acSendReport, stDocName, "SnapshotFormat(*.snp)", stEmail, , , "PCA Authorization Request", "Please review this product change and authorize when appropriate."
Exit_cmdPCAuthSend_Click:
Exit Sub
End Sub
View 5 Replies
View Related
Jun 13, 2005
Im using the code below to send information by email. BUT:
I want to send the same information to more than one recipient. can i write more than one address in the SendObject?
What can i do if i do not know prior to sending how many addresses i want to include. (this means that once i might have tosend it to 1, then later to 3, etc...)?
The code is:
Private Sub cmdMailTicket_Click()
On Error GoTo Err_cmdMailTicket_Click
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim stTicketID As String '-- The ticket ID from form
Dim stWho As String '-- Reference to tblUsers
Dim stHelpDesk As String '-- Person who assigned ticket
Dim strSQL As String '-- Create SQL update statement
Dim errLoop As Error
'-- Combo of names to assign ticket to
stWho = Me.cboAssignee
stWhere = "tblUsers.strUserID = " & "'" & stWho & "'"
'-- Looks up email address from TblUsers
varTo = DLookup("[strEMail]", "tblUsers", stWhere)
stSubject = ":: New Help Desk Ticket ::"
stTicketID = Format(Me.txtTicketID, "00000")
RecDate = Me.txtDateReceived
'-- Helpdesk employee who assigns ticket
strHelpDesk = Me.cboReceivedBy.Column(1)
stText = "You have been assigned a new ticket." & Chr$(13) & Chr$(13) & _
"Ticket number: " & stTicketID & Chr$(13) & _
"This ticket has been assigned to you by: " & strHelpDesk & Chr$(13) & _
"Received Date: " & RecDate & Chr$(13) & Chr$(13) & _
"This is an automated message. Please do not respond to this e-mail."
'Write the e-mail content for sending to assignee
DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
'Set the update statement to disable command button
'once e-mail is sent
strSQL = "UPDATE tblHelpDeskTickets SET tblHelpDeskTickets.ysnTicketAssigned = -1 " & _
"Where tblHelpDeskTickets.lngTicketID = " & Me.txtTicketID & ";"
On Error GoTo Err_Execute
CurrentDb.Execute strSQL, dbFailOnError
On Error GoTo 0
'Requery checkbox to show checked
'after update statement has ran
'and disable send mail command button
Me.chkTicketAssigned.Requery
Me.chkTicketAssigned.SetFocus
Me.cmdMailTicket.Enabled = False
Exit Sub
Err_Execute:
' Notify user of any errors that result from
' executing the query.
If DBEngine.Errors.Count > 0 Then
For Each errLoop In DBEngine.Errors
MsgBox "Error number: " & errLoop.Number & vbCr & _
errLoop.Description
Next errLoop
End If
Resume Next
Exit_cmdMailTicket_Click:
Exit Sub
Err_cmdMailTicket_Click:
MsgBox Err.Description
Resume Exit_cmdMailTicket_Click
End Sub
View 3 Replies
View Related
Jan 25, 2012
I'm using DoCmd.SendObject to send an e-mail using Windows Live Mail.
Works great UNLESS the recipient name contains a "_" character as in
joe_blow@isp.com. joeblow@isp.com works just fine.
I get RT Error 2293 "Access can't send this e-mail message"
Is this a WLM problem? SendObject problem? VBA? my code?
Are there character restrictions for the e-mail name? If so that is bad because these are valid names for users. What am I doing wrong and how do I correct the syntax so that these e-mail names can be accepted?
WIN 7, Access 2010
View 14 Replies
View Related
Dec 28, 2007
Have found some code that originated from this forum, and have modified it to suit my needs. There's one form with all the information, that has multiple buttons and subsequently multiple functions to generate emails, with each button/email to generate a different format and content. The first use of a button works fine, but trying to use the next button right after does nothing. If you exit the form and re-enter, you can then use the next email button, but that's a pain and the users won't like that. Can anyone help? I've pasted a sample of the code that is being used below, it's duplicated and changed slightly for the other buttons. I currently have the button linked to a macro that does other things like saving, and setting dates and then running the function.
Thanks,
Don
-----------------------------------------------------------------
Public Function AckEmailNew()
On Error GoTo Err_cmdMailTicket_Click
Dim varTo As String '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim stTicketID As String '-- The ticket ID from form
Dim strSQL As String '-- Create SQL update statement
Dim errLoop As Error
varTo = Me.ClientEmail
stTicketID = Me.STSITicket
stSubject = "Ticket/numéro de référence: " & stTicketID
stText = <<My text goes here>>
'Write the e-mail content for sending to assignee
DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
On Error GoTo Err_Execute
Exit Function
Err_Execute:
MsgBox Err.Description
Resume Exit_cmdMailTicket_Click
Exit_cmdMailTicket_Click:
Exit Function
Err_cmdMailTicket_Click:
MsgBox Err.Description
Resume Exit_cmdMailTicket_Click
End Function
View 5 Replies
View Related
Apr 27, 2015
When I send an email from Access with SendObject, how does it determine the user name, the 'from' name. Is it just the user's Outlook name? Do I have any control over that?
View 1 Replies
View Related
Jan 29, 2015
I have some code that takes data from my database and creates an email with it. It also creates a folder and a word document. In the email, I would also like to include the file path as a link instead of just the path that it puts there now. Is this possible to do?
Code:
Option Compare Database
Private Sub SendEmail_Click()
On Error GoTo Err_open_word_Click
Dim oApp As Object
Dim path As String
[Code] .....
View 1 Replies
View Related
Jul 9, 2014
I have a database that pulls images from a shared folder on our network with links. Is it possible to create a button to email the current record on a form and attach the file it references in the link?
The attachment is a pdf signature. I didn't want to include the files in the database for space issues.
I am using Access 2007. We out outlook as our email client.
View 1 Replies
View Related
Sep 2, 2015
I'm trying to automate a process of selecting a set of file/s and move them in a folder. When I click on a button, it should open a current folder that is setup in the code.
Lets say that I have a folder C:documents est, and very time I click on the button, it should open the dialog box with that path so I can select the files from another folder, drag them there and they will be saved in that folder.
This will form part of wider automation that will send an email stating that those file/s where placed in that folder.
I have in the same form where the button is placed, 3 check boxes that needs to be passed to the email as well that one or all the files where placed in the folder.
View 10 Replies
View Related
Mar 16, 2015
I'm trying to open a folder based on a BIN nr. This folder could be in a main folder that has diferent subfolder. As there where differnt naming used to create the folderes, one of the things they have always is the BIN nr. It alwasy start with a unique number and maybe I could use it to scan the subfolders and open that one that the BIN nr is equal as in the field BIN.
Now we have serveral 1000th of folders and finding them takes time.
View 3 Replies
View Related
Sep 16, 2013
I want to automate an email to include the senders email addres with some text in the body of the email.
Code:
Private Sub send_mail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
[Code] ....
View 3 Replies
View Related
May 23, 2013
I currently have a database where users input new parts into a database using a part form. When they put in the part type, a tracking number is automatically generated. I would like a folder to be created for each part where we can store pictures and a report. How would i have it create a report to a certain area using the tracking number as the folder name? I also want to be able to upload pictures and eventually save the report in there but creating the folder is the first step.
View 7 Replies
View Related
Mar 14, 2013
I have a folder called site docs on our server m:/estates/sitedocs...I want to have a button that opens this folder but in the correct site sub folder
Ie:- primary Key on form site number 0001S if i click site docs button i want it to open folder in estates.sitedocs/0001S or which ever site number form i am in for that site number
View 1 Replies
View Related
Jun 20, 2015
I want to re link all my tables from other database which location is same folder.
If a user open db1.mdb it automatically re link all tables from db1_be.mdb every time. If not exist db1_be.mdb in current folder it'll show a message.
folder name : test
test
--db1.mdb
--db1_be.mbd
View 1 Replies
View Related
Jul 13, 2014
how can i make a folder from my windows 7 opens when i click on a image?
View 11 Replies
View Related
Jul 10, 2013
I am trying to link an images (.png) onto a form. I have a folder of all the images I want but I want the path to be relative. So that if I move the access file and the images folder to a new location, it will still work.
In the properties for the image, It works fine as C:UsersjohnDesktopimage1.png but what I am looking for is the ability to use "imagesimage1.png" as the file will always be in that relative folder to the db.
What is the correct syntax for this? putting image1.png in the same directory and just using image1.png works, but this won't be very tidy with 100+ images.
I have tried:
imagesimage1.png
imagesimage1.png
imagesimage1.png
With PictureType set as linked.
I know from searching it is possible through VBA by getting the root directory of the folder and appending the filename. Don't really want to go this root. I also don't particularly want to create a table to store the images or links.
View 8 Replies
View Related
Nov 9, 2014
I have recently been experimenting with adding an Access database to a shared folder (in a network HomeGroup) and have it working on two networked PCs. Then tried the same with the database split but I get a path error on the PC joined to the HomeGroup (where the database resides) whenever the backend (tables) are accessed by a form or from the Tables listing. If I however open the backend file directly from the file directory, the tables all open as expected.
The path stated as being invalid in the error message starts with "C:Usersetc..... instead of LAF-PCUsersetc..... so it looks (to me at least) that it is attempting to load the file from the local hard drive rather than the host computer.
Why a split database works differently in this situation than a non-split.
View 13 Replies
View Related
Nov 26, 2014
I have 3 attachment boxes in my table that appears in a form.each attachment box contains specific files (not specific as in extension such as PDF, JPEG, etc.) but specific as in Company Documents, Certifications, Resumes. The issue is there's a lot of document and I see my database growing (fast)...My question finally is....
Can I use a Hyperlink to open a folder within a specific directory where multiple file are located so i can open the specific file need there RATHER than attaching them in the attachment box individually?.?.....If not how this can be done (no SQL) unless that route is very simple and basic coding.
My thinking would be to place the file path to the documents in the table and hyper link that column in the table, but not knowing exactly how Hyperlinks work I don't think it would actually work..
View 6 Replies
View Related
Aug 12, 2014
All, using access 2010. I am using this code to make a folder upon exporting a query to excel:
Code:
sPath = "C:Directorymainfolder" & Format(Date, "yyyy mm dd") & "folder"
MkDir sPath
It works however I need a space between the date and the folder. But when I use "", it tells me path doesn't exist. get a space in the name when creating the folder.
View 8 Replies
View Related
May 23, 2014
I have a form with a subform.In the footer of the subform I have a combobox that get the file names of excel spreadsheets from a folder.I have a button (no code on it yet) that I want to press and import that spreadsheet into the table for the subform and associate it with the main form.
View 11 Replies
View Related
Jul 8, 2013
I have a MS access db with a report that displays a list of students with a pic of their face on the side.
The pics are linked to a folder thats inside the folder where the .accdb file is stored.
The accdb is often moved around, but when it does, all the links become broken and the images are no longer displayed on the list.
How can i adjust the link path so that regardless of where the accdb is moved, the links remain valid?
I am using ms2007 and also its not a networked area but rather a bunch of standalone computers.
View 14 Replies
View Related
Feb 19, 2015
I am simply trying to create a command button to open a folder on my desktop
Cannot seem to find this code
This is the path to the folder I want to open
C:UsersJONATHANDesktopCMS FILES
View 4 Replies
View Related
May 16, 2014
I have a code to add links to files into a field, I recently migrated from Windows 7 to 8 and the name of the folders in 8 are different; therefore the database I have does not find the linked file anylonger.
To avoid this happening in future, I would like to have the option for the user to set the folder path through maybe a table and then the link will refer to the settings in the table.
Currently I am using the following code:
Private Sub AddLinkDoc_Click()
Dim strFilter As String
Dim strInputFileName As String
Dim varDirectory As String
varDirectory = "C:UsersMarco TagliaferriDocumentsBA CityflyerCrew SchedulerDocumentationDocs"
[Code] ......
View 2 Replies
View Related
Oct 19, 2005
Hey Guys,
I have the sendobject currently working so that when the database is opened, it sends the required mail. But i would like it to send an email once a month, is there a way around this??
View 2 Replies
View Related
Nov 23, 2005
Does anybody know if it's possible, using the SendObject command, to change the Name of the attachment it creates? Rather than having the Name of say the report, changing it to tha date/time.
Any help appreciated.
View 2 Replies
View Related
Nov 2, 2007
Hello everyone,
The DoCmd.SendObject command was working fine. Now it is giving me
a run-time error '2501' saying "The SendObject action was canceled"
Would anyone know why this is happening??
Thanks
PS:I looked up for this error number but it doesn't say anything related to the SendObject method
View 5 Replies
View Related