Automatically Link to PDF (1 Viewer)

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 08:23
Joined
Feb 5, 2019
Messages
292
Hello all,

I am in the throws of design a FAIR (First Article Inspection Report) database to add to my growing list of modules at work.

All of the goods we receive have a scanned GRN (Good Received Note) that is stored in the same folder on our server.

If I create a table where someone could input the GRN, IE 047990, is there a way I can get Access to convert that into a link to open the PDF when clicked, IE Hyperlink to \\universe\scanned GRNs\047990.pdf

Thank you in advance

Matt
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:23
Joined
Oct 29, 2018
Messages
21,357
Hi Matt. There are several ways to do that. The simplest one is to use the Application.FollowHyperlink method.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 08:23
Joined
Feb 5, 2019
Messages
292
Hi Matt. There are several ways to do that. The simplest one is to use the Application.FollowHyperlink method.
Thank you, I shall give that a try.

Another potential add on here would be the ability to send the FAIR to the customer via email, and attach all referenced PDF's in a zip file format.

Or is that aiming too high? Some FAIRs may have close to 20 PDFs to attach.

~Matt
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:23
Joined
Oct 29, 2018
Messages
21,357
Thank you, I shall give that a try.

Another potential add on here would be the ability to send the FAIR to the customer via email, and attach all referenced PDF's in a zip file format.

Or is that aiming too high? Some FAIRs may have close to 20 PDFs to attach.

~Matt
Emailing with attachments is easy. Making a zip file will take some code to accomplish.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 08:23
Joined
Feb 5, 2019
Messages
292
Emailing with attachments is easy. Making a zip file will take some code to accomplish.
Thank you DBguy,

I shall work on the first part and tackle the zip files/email after I have the main part working.

~Matt
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:23
Joined
Oct 29, 2018
Messages
21,357
Thank you DBguy,

I shall work on the first part and tackle the zip files/email after I have the main part working.

~Matt
Sounds good. Let us know how it goes...
 

mkdrep

Registered User.
Local time
Today, 04:23
Joined
Feb 6, 2014
Messages
176
Emailing with attachments is easy. Making a zip file will take some code to accomplish.
I have set up my database to create an email in Outlook. You mention in your comment that "emailing with attachments is easy". Can you direct me to a link which explains how to do just that?
Thank you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:23
Joined
Oct 29, 2018
Messages
21,357
I have set up my database to create an email in Outlook. You mention in your comment that "emailing with attachments is easy". Can you direct me to a link which explains how to do just that?
Thank you.
You can attach any Access object in an email using the SendObject method. If you're using Outlook automation, then you can use the Attachments.Add method.
 

mkdrep

Registered User.
Local time
Today, 04:23
Joined
Feb 6, 2014
Messages
176
Perhaps I didn't fully explain what I am trying to accomplish.
I'm trying to attach a (.pdf), which I've previously created using Access and then attach that (.pdf) to the email I create in Outlook using the steps I have already set up in Access.
Excuse me if I misunderstand you, but the method you are talking about seems like I just create the email to a customer in Access, which opens in Outlook and then I just search and attach the document in Outlook just like I would do with any email I send in Outlook.
 

mkdrep

Registered User.
Local time
Today, 04:23
Joined
Feb 6, 2014
Messages
176
This is the code I've used to create an Outlook email in Access. Perhaps I can't automatically pull a (.pdf) that I have created in Access and I'll just have to attach it manually?

Sub SendEmail()

Dim oOutlook As Outlook.Application
Dim oEmailItem As mailitem
' prevent 429 error, if outlooknot open
On Error Resume Next
Err.Clear
Set oOutlook = GetObject(, "Outlook.application")
If Err.Number <> 0 Then
Set oOutlook = New Outlook.Application
End If

Set oEmailItem = oOutlook.CreateItem(olmailitem)
With oEmailItem

.to = [Distemail]
.display
End With
Set oEmailItem = Nothing
Set oOutlook = Nothing

End Sub
Private Sub send_email_Click()
Call SendEmail
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:23
Joined
Oct 29, 2018
Messages
21,357
Hi. If you created a pdf from Access, I am saying you should be able to automatically send it as an attachment without creating it first. When you use the SendObject method, Access will automatically create the pdf for you.

But, if you want to stick with what you already have, then just use the Attachments.Add method to attach the pdf you already created into the email you're creating. Neither of those two suggestions will require you to manually add the attachment to the email.

Sent from phone...
 

mkdrep

Registered User.
Local time
Today, 04:23
Joined
Feb 6, 2014
Messages
176
Thank you very much for the detailed explanation. I'll work on this some more and see what I can come up with.
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:23
Joined
Sep 21, 2011
Messages
14,037
Thank you very much for the detailed explanation. I'll work on this some more and see what I can come up with.
Just search this site. This question comes up time and time again.
 

Users who are viewing this thread

Top Bottom