Go Back   Access World Forums > Apps and Windows > Visual Basic

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-24-2019, 08:06 AM   #16
Access_Help
Newly Registered User
 
Join Date: Feb 2005
Posts: 89
Thanks: 35
Thanked 0 Times in 0 Posts
Access_Help is on a distinguished road
Re: Attach second report to email

Quote:
Originally Posted by June7 View Post
That is described back in post 5.
Thanks, but how do I modify the original post in Post#1 to make HTML compatible hyperlinks?

__________________
Not an Access Programmer
But want to be one day....
Access_Help is offline   Reply With Quote
Old 03-24-2019, 11:11 AM   #17
June7
Newly Registered User
 
June7's Avatar
 
Join Date: Mar 2014
Posts: 2,029
Thanks: 0
Thanked 486 Times in 482 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Attach second report to email

What exactly do you not understand about the example code? You said your hyperlink works so you must have already written code to test. If you want to dynamically build hyperlink in code, then concatenate variable. Where will the hyperlink string come from? Post your attempted code.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 03-24-2019, 07:35 PM   #18
Access_Help
Newly Registered User
 
Join Date: Feb 2005
Posts: 89
Thanks: 35
Thanked 0 Times in 0 Posts
Access_Help is on a distinguished road
Re: Attach second report to email

Quote:
Originally Posted by June7 View Post
What exactly do you not understand about the example code? You said your hyperlink works so you must have already written code to test. If you want to dynamically build hyperlink in code, then concatenate variable. Where will the hyperlink string come from? Post your attempted code.
Sorry, I should have been clearer. I am trying to add a text to the hyperlink as shown in bold below, but it just displays the code and does not convert it to an actual hyperlink. How do I modify the code to allow HTML formatting?

Code:
Public Sub Command6_Click()
Dim vTo, vCC, vSubj, vBody, vRpt, vForm, vHoy
Dim vFilePath
Dim i As Integer
vRpt = "Report"
vQry = "qry_difference_achievement"



'scan the list box
For i = 0 To lstEAddrs.ListCount - 1
   vItm = lstEAddrs.ItemData(i)   'get new item
   lstEAddrs = vItm                   'set list box to item
  
   DoCmd.OpenReport vRpt, acPreview, , "[Form]= '" & lstEAddrs.Column(0) & "'"
   
   vName = lstEAddrs.Column(1)
   vForm = lstEAddrs.Column(0)
   vHoy = lstEAddrs.Column(4)
   vSubj = "XYZ: " & vForm & ""
   vTo = lstEAddrs.Column(2)      'col 1 has ID, col2 has email  (in vb, combo box items starts with 0)
   vCC = "xyz@gmail.com;" & vHoy & ""
   vBody = " "Test HL: <a href='folder path here'>Link description here</a>""

   
            'send report
   DoCmd.SendObject acSendReport, vRpt, acFormatPDF, vTo, vCC, , vSubj, vBody
   DoCmd.Close acReport, "Form_Report"
   
Next
End Sub

__________________
Not an Access Programmer
But want to be one day....
Access_Help is offline   Reply With Quote
Old 03-24-2019, 11:51 PM   #19
June7
Newly Registered User
 
June7's Avatar
 
Join Date: Mar 2014
Posts: 2,029
Thanks: 0
Thanked 486 Times in 482 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: Attach second report to email

That's really the same procedure you originally posted.

Then what do you mean when you said the hyperlink works perfectly?

Follow the example code. Modify to use your info.

Can't use SendObject. Must use Outlook automation and HTML code tags.

And if you want to include report attachment, the report must be saved to a PDF file then that file can be attached to email.

__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to attach a report to access email zoona Modules & VBA 1 11-03-2014 05:02 AM
Transfer data from form to report and then attach report to email cino89 Reports 0 10-24-2014 04:29 AM
Converting report to PDF and attach it to email crxftw Reports 2 07-05-2011 10:47 AM
Converting report to PDF and attach it to email crxftw General 2 07-05-2011 12:42 AM
Automatically attach a report as a PDF into my email myhnews Reports 5 05-10-2007 06:45 PM




All times are GMT -8. The time now is 04:43 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World