Hamish 237
New member
- Local time
- Today, 11:23
- Joined
- Jun 19, 2019
- Messages
- 16
Hi all im sure there is posts out there that cover this but everything i found was very old or seemed overly complex so i thought id ask the question fresh.
My Case file i have a simple database that stores vehicle data and repair history new repairs are documented and the report / workcard is stored in a subfolder under the respective vehicle main folder Application.CurrentProject.Path & "\" & Me.VHID.Column(1) & "\" & "Fault" & "\" & Me.CLID the report is stored as a pdf in this folder named the same as the folder along with images of the fault that was repaired
Where the vehicle is still in its warranty period this information is then forwarded to the supplier as a warranty claim submission,
I cant control the names of or the file type of image being saved. so i'm looking for a "wild card" way to attach the PDF and the jpg / bitmap/mpeg etc and if possible open up the default windows compress images to help the users control the size of images being sent
Currently the DB opens an email with the report attached as a PDF then the user has to save the email as a draft first then navigate to the folder to drag and drop the pictures in to the draft email
I did find some coding to loop through files in the folder that i think would have helped with the below but i just wasn't sure how to combine it I did get the below to work with just a single PDF attachment from the folder
PS
go gentle on me people i'm no programmer i just enjoy learning new stuff
and getting satisfaction from making things work
' PROGRESS SO FAR
'------------------------------------------------------------
' emlclm_Click
'
'------------------------------------------------------------
Private Sub emlclm_Click()
On Error GoTo emlclm_Click_Err
Dim objOutlook As Object
Dim objMail As Object
Dim Filepath As String
Filepath = Application.CurrentProject.Path & "\" & Me.VHID.Column(1) & "\" & "Fault" & "\" & Me.CLID
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.To = "Her@him.com.au"
.Subject = "Test"
.Body = "Hope this works"
'\\Attacment from here
'THIS IS WHERE I THINK I REALLY NEED THE HELP
"
.Attachments.Add Filepath & "\" & "*.PDF"
.Attachments.Add Filepath & "\" & "*.jpg"
.Display True
End With
Set objMail = Nothing
Set objOutlook = Nothing
emlclm_Click_Exit:
Exit Sub
emlclm_Click_Err:
MsgBox Error$
Resume emlclm_Click_Exit
End Sub
My Case file i have a simple database that stores vehicle data and repair history new repairs are documented and the report / workcard is stored in a subfolder under the respective vehicle main folder Application.CurrentProject.Path & "\" & Me.VHID.Column(1) & "\" & "Fault" & "\" & Me.CLID the report is stored as a pdf in this folder named the same as the folder along with images of the fault that was repaired
Where the vehicle is still in its warranty period this information is then forwarded to the supplier as a warranty claim submission,
I cant control the names of or the file type of image being saved. so i'm looking for a "wild card" way to attach the PDF and the jpg / bitmap/mpeg etc and if possible open up the default windows compress images to help the users control the size of images being sent
Currently the DB opens an email with the report attached as a PDF then the user has to save the email as a draft first then navigate to the folder to drag and drop the pictures in to the draft email
I did find some coding to loop through files in the folder that i think would have helped with the below but i just wasn't sure how to combine it I did get the below to work with just a single PDF attachment from the folder
PS
go gentle on me people i'm no programmer i just enjoy learning new stuff

' PROGRESS SO FAR
'------------------------------------------------------------
' emlclm_Click
'
'------------------------------------------------------------
Private Sub emlclm_Click()
On Error GoTo emlclm_Click_Err
Dim objOutlook As Object
Dim objMail As Object
Dim Filepath As String
Filepath = Application.CurrentProject.Path & "\" & Me.VHID.Column(1) & "\" & "Fault" & "\" & Me.CLID
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.To = "Her@him.com.au"
.Subject = "Test"
.Body = "Hope this works"
'\\Attacment from here
'THIS IS WHERE I THINK I REALLY NEED THE HELP

.Attachments.Add Filepath & "\" & "*.PDF"
.Attachments.Add Filepath & "\" & "*.jpg"
.Display True
End With
Set objMail = Nothing
Set objOutlook = Nothing
emlclm_Click_Exit:
Exit Sub
emlclm_Click_Err:
MsgBox Error$
Resume emlclm_Click_Exit
End Sub