Modules & VBA :: Embedding A Picture Into Email
Sep 24, 2014
I am trying to embed a picture in an email, code below:
Code:
Dim MyOutlook As Object
Dim MyMail As Object
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
[Code] ....
View Replies
ADVERTISEMENT
Mar 5, 2006
Hi
From advice I have read on here I have worked out how to create a button on a form which opens a report to show the values which match the record open on the form. It then attaches that page as a txt file to an email. Which is great.
What I would like it to do though is insert into the body text of the email the text from the report. Have looked as much as I can at the properties of DoCmd.SendObject acSendReport but cannot achieve this myself.
What I have is pretty much this:
Code:DoCmd.SendObject acSendReport, "Your matching details this week", acFormatTXT, Me!PersonEmail, , , "Details this week " & Date, "Please see the attached text file for details this week which match your selection criteria.", False
How can I make the text appear within the email body?
View 14 Replies
View Related
Jan 15, 2014
I have a form which has a button to email the data out in a standard email message.
Private Sub Command60_Click()
Dim MyDb As dao.Database
Dim rsEmail As dao.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String
[code]...
This works well enough, however, FIELDS 11 through to 16 contain the venue address. This is all we ll and good if every field of the venue address is populated. here are times when not all of the fields are populated, for instance, the address might only be 5 lines.I know I can do this using IIf statements on a report, but how can i achieve the same thing for the email.
View 6 Replies
View Related
Jul 16, 2014
I have made a query with the name "Confirmation" and it is setup like this:
Name trainee Email Training
John John@mail.com Tr one
Mary Mary@mail.com Tr two
I also made a button in a report with the title "Send Mail" now is my goal that if i press that button automatically multiple e-mail message's will be generated with data from people in that query. So if click on that "Send Email" button i want two different mails messages generated that will be send to John@mail.com and Mary@mail.com with in the mail body their data.
View 13 Replies
View Related
Jan 19, 2015
I am currently using vb code to send an email in Access on the click of a button. I want the database user to be able to enter the recipient in a text box [ToEmail] which is on form [GroupStockProfiler]. However, I'm unsure how to put this into my code. I currently have the following which doesn't work (unless I put a specific email after 'To'):
Private Sub Command414_Click()
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0
[code]...
View 1 Replies
View Related
Jul 8, 2014
I want to display a picture (or pictures) from Imagelist in the picturebox (KIBES_picture).But I am getting a type mismatch error in the last line. What am I doing wrong?
Code:
Public Sub load_picture()
Dim iml As ImageList
Set iml = New ImageList
iml.ListImages.Add , , LoadPicture("K:Kapa-Planung ElektrikKibes_DatabaseAufbausystemme2_Innenbeleuchtung .00000-0002_Treppebeleuchtung_ueber_2 Schalters_087A00ekran_edycja.jpg")
[Forms]![Search]![KIBES_picture].Picture = iml.ListImages(1)
Besides, when I have Listimage(0) I am getting an other error: Index out of bounds. Strange, because the index should start from zero?
View 1 Replies
View Related
Oct 4, 2014
I use the botton code for save image in SQL
Dim fDialog As Object
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Set Cn = New ADODB.Connection
Cn.Open "Provider=SQLOLEDB;data Source=.;" & _
[Code] ....
But I have a problem when my database more than 2000 record. I think my problem in
rs.Open "Select * from Table_2", Cn, adOpenKeyset, adLockOptimistic
because select all record in Table_2
I decided to use bottom code
strSQL = "INSERT INTO Table_2(image_v,sabt,filetype_v,imageid) Values (mstream.Read,'" & [kodimage] & "','" & [file_type] & "','" & Me.Text8 & "');"
Cnxn.Execute strSQL
But I get an error with mstream.Read!!!!
View 3 Replies
View Related
Aug 3, 2015
I have an automated email system (Lotus Notes) in a Access database I have created and am looking for the code needed to add up to 3 c.c addresses into an email prior to sending automatically.
The code I have to send the email to the To: individual is all working but what code I need to add and where for the c.c addresses of which there could be 1, 2 or 3. The control for To address is EmailTo = CustCopyEmail The controls for the 3 c.c emails are cc_EmailAddress, cc_EmailAddress1 and cc_EmailAddress2.
Here's the code I have:
Private Sub SEND_CC_Click()
' Set up the objects required for Automation into Lotus Notes.
Dim Maildb As Object 'The mail database.
Dim Session As Object 'The Lotus Notes session.
Dim MailDoc As Object 'The mail document itself.
Dim UserName As String 'The current users Lotus Notes name.
[code]....
View 8 Replies
View Related
Jan 29, 2014
I want to my ImageFrame to open as a picture. My problem is that my picture could be either a .jpg or a .png (or whatever). The code below works if I hard code profile_pic.png or profile_pic.jpg. Is there a way to use the wildcard here? (Its not working as written now)
Code:
Dim vFolderPath As String, strFile As String, dirFile As String
vFolderPath = DLookup("FolderName", "tblCodes-FolderControl", "FolderKey = '" & "Profile" & "'")
dirFile = Dir(vFolderPath & ctrl_people_id & " *", vbDirectory)
strFile = "profile_pic." + "*"
[code]...
View 8 Replies
View Related
Feb 8, 2014
I have below module to save picture under named folder:
Code:
Option Compare Database
Public Enum acFileType
acPicture = 1
acFiles = 2
End Enum
[Code] ....
But how to save the picture with customized name, say "Materials 0001.Jpg"
View 7 Replies
View Related
Dec 17, 2013
I am trying to export an attachment item (Picture .jpg) to a word document. I have been exporting text to a word document successfully with below syntax "
With rst
strLandSalesID = Nz(.Fields("LandSalesID"))
strPhotograph = Nz(.Fields("Attachments"))
However, attachment do not work.
View 3 Replies
View Related
Jul 17, 2015
A newbie problem: Trying too display a linked picture using Win 8.1, get error picture too large. OK in Win 7.
Am using Access 2002 (10.6501.6567) SP3. The instruction flagged is:
Me![ImageFrame].Picture = Me![ImagePath]
View 1 Replies
View Related
Aug 13, 2015
I'm having trouble with a shell() command in my vba.
I'm trying to call up the picture viewer showing the file of the photo I clicked on in a form. Everything is happening as expected - the file opens in Windows Photo Viewer, but it is minimized.
I can open a picture fine from Windows Explorer, but something about my shell command is forcing a minimize.
Here is my code:
Code:
Dim sFile As String
PicFile = "C:Pics" & Me!PicName & ".jpg"
Shell "RunDLL32.exe C:WindowsSystem32Shimgvw.dll,ImageView_Fullscreen " & PicFile
I would have assumed ImageView_Fullscreen would do what I want!
View 4 Replies
View Related
Mar 28, 2014
I've been trying to search for all picture files in my documents and copy them to a folder on the desktop. I found this and it work great for searching however I'm having trouble getting the copy to work. [URL] ....
Code:
Dim colFiles As New Collection
RecursiveDir colFiles, "C:Photos", "*.jpg", True
Dim vFile As Variant
For Each vFile In colFiles
Debug.Print vFile
Next vFile
Code:
I replaced the debug.print vfile with my copy function. I've tried copyfile but it needs to specify the destination with the file name. I tried using the FSO filecopy method and can't get it to work (keep getting a compile error "Expected =") I feel the hard part is done and this part should be simple.
View 3 Replies
View Related
Dec 12, 2007
In an attempt to keep the aged and wise users of the DB from overlooking the "display as Icon" cbo when embedding PDF's, and thus finding them unaware of attached documents, I'm searching for a way to select this by default to eliminate the problem altogether.(leban's didn't seem to say anything helpful on the matter)
Any ideas, virtual-mentors?
View 3 Replies
View Related
Jan 26, 2007
I am wondering if it is possible to embed all of the photos that I have into my photo table automatically. I have the table set up with all of the data that needs to be there but I have over 1500 photos that need to be embedded and wanted to save myself some time and automate the process somehow. I already know that embedding these photos is going to make my database huge but that isn't an issue for this particular project.
As far as I can tell from this forum, the help and the Northwind database this isn't possible without manually going through every photo but I am pretty new to Access so thought I would throw the question out there.
Thanks
View 14 Replies
View Related
May 14, 2006
Is there any way to embed a report in a form?
What I want to do is something similar to using a subform, but I want to use a subreport as part of a region of a form (linked by the master/child fields).
The reason for this is because it is impossible to draw lines on a form. I MUST be able to do so (I've been through all the API stuff and after 3 hours, I realize it's just not an option). I can easily get a report to look the way I want it, and I want to display the section that has lines in the report.
Yes, I realize that it's read-only; there will be another interface for getting the data in. I just want to display it graphically with connecting lines.
Thanks,
SHADOW
View 3 Replies
View Related
Dec 4, 2012
I have an access icon (*.ico) file associated with my DB. But when I try to access the database from a place other than my desktop where the icon is located the icon doesn't show up. Is there any way to embed the icon into the application so that when the database is loaded on a different machine the icon loads too..
View 2 Replies
View Related
Jun 21, 2014
I'm using Access 2010's DoCmd.OutputTo in VBA to export reports to PDF. The "look and feel" of the PDFs are very important, as they will be distributed to clients of my company. I'm using special corporate fonts that are legally licensed for embedding as a subset. Two are .ttf (TrueType) and two are .otf (OpenType) fonts. The ttf fonts embed fine; the otf fonts do not, and the PDF viewer substitutes something it thinks is close (but really isn't). In the properties of the fonts in Windows Control Panel, the embedding properties are exactly the same for both.
Any way to force the fonts to embed? or any other workaround? Also, is there any way to edit-protect PDFs with VBA code? Or apply any other type of PDF security such as requiring a password to open?
View 3 Replies
View Related
Aug 16, 2012
I have a database in which i have a table imagemaster including fields as id,name,image(attachment)
Now I have a form on which image name is there on label
I have an imagecontrol on the form with no picture at start
I use dlookup function on formload event which pull image from the imagemaster table.
When my form is loaded it show ( can't open the file 1.png ) which is exactly the file from the table that i want to open. It means it goes right there to the source but cannot open that or embed that into my image control.
View 1 Replies
View Related
Jun 28, 2013
I have a form that I call the AdminForm. It allows the user to store administrative information about the business; business name, address, telephone number, etc. I also have as a part of the table that stores this information an Attachment Field where an image of their logo is stored in a field called, [Logo]. No problem here. The issue is that I want to use the [Logo] field elsewhere like in reports.
I've added an Attachment type control to the report and I've used DLookUp to use the image stored in the admin table, but it doesn't display on the report. There isn't any relationship between the admin table and any report so I can't join them unless I do something "unnatural" by adding a fictitious field to every record to tie it back to the key field in the admin table, (there is never more than one record in the admin table; I ensure that). That doesn't seem like the right way to accomplish this.
View 9 Replies
View Related
Dec 4, 2014
I have a form that I would like to update a picture on using VBA. The source of the picture path is in part a query that is not bound to the form. So far I have the following code that is pretty much working, but with a couple flaws.
Code:
Private Sub Form_Current()
LoadDefaultPicture
End Sub
Sub LoadDefaultPicture()
Dim db As DAO.Database
[Code] ....
This is working. However, when I change the record the picture flashes the current picture once and then loads the new picture. It is like it reloads the current picture then loads the new one. I'm hoping there is a way to get rid of the flash.
Also, the code fails here:
strDefaultPictureName = rs.Fields("AttachmentName")
When the query does not return a record. I can definitely fix this by adding an if statement to check for a record, but I'm kind of perplexed at why it is failing at that line. I would expect it to assign an empty string to that variable name and then fail on the next command where I try and set the ".Picture" property of the image.
View 8 Replies
View Related
Nov 16, 2013
Sending email using VBA & HTML. I want send email from access. Message in body contains some text and table in HTML format. I need check if email was really sent or cancelled with user.
Code:
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
[Code] ...
I need some message (for example):
If error then
MsgBox "Email not sent"
Else
MsgBox "Email sent"
End If
View 2 Replies
View Related
Oct 22, 2013
I have created something from our transport department and need to set up so he can select a command button and email from a query, but where would I put the query details in the coding below
VBA used
Dim strSQL
Dim db As DAO.Database
Dim MailList As DAO.Recordset
Dim objOutlook As Outlook.Application
Dim objemail As Outlook.MailItem
Dim Subjectline As String
Dim BodyFile As String
[code]....
View 1 Replies
View Related
Jan 28, 2015
I am having troubles adding email addresses to my CC box in my email. I am able to get the emails to populate into the "To:" space. Now I know I have the DLookup accessing the same record, but how can I make it so the CC_List puts the emails into the CC of the email?
Code:
Dim DailyReport As Integer
Dim EmailRecipiantsList As String
Dim RecipiantName As String
Dim CC_List As String
[code]....
View 14 Replies
View Related
Jul 17, 2013
Using Access 2007 and Lotus Notes 8.5 ...I've got some code to output a report to email as an attachment: it looks like this
DoCmd.SendObject acSendReport, "rep09emailnotification", acFormatRTF, "(Recipients)", , , "email subject", "email body text", 0
For MOST of the people who use the database, this works fine, and they send the email with the RTF attachment which all the recipients can open - but for some users, it generates a .tmp file which if you 'Open' it is just a load of gobbledegook, but it you 'View' it looks ok - but is truncating the report.what could be causing Access 2007 to create .tmp files rather than .rtf?
View 5 Replies
View Related