'Declare Variables
Dim EmailApp As Object
Dim EmailItem As Object
Dim myAttachments As Object
Dim mailAddress As String
Dim TaxCertPDF As String
Dim NorryLink As String
' Dim EMail As String
'Set Variables
Set EmailApp = CreateObject("Outlook.application")
Set EmailItem = EmailApp.CreateItem(0)
Set myAttachments = EmailItem.Attachments
' E-Mail Subject Parcel - Requestor - Date.pdf
TaxCertPDF = "T:\2022_TAX_CERTS\" & Sheets("Tax Cert Bill").Range("B17").Value & " - " & Sheets("Tax Cert Bill").Range("B12").Value & Format(Date, " - mm-dd-yyyy") & ".pdf"
NorryLink = "https://tax.norrycopa.net/taxclaim/trirsp2pp.asp?parcel=" & Sheets("Tax Cert Bill").Range("B17").Value
Dim FinalResult As Variant, Table_Range As Range, LookupValue As Range
Set Table_Range = Sheets("Requestor").Range("A:B")
Set LookupValue = Sheets("Tax Cert Bill").Range("B12")
FinalResult = Application.WorksheetFunction.VLookup(LookupValue, Table_Range, 2, False)
Dim html As MSHTML.HTMLDocument
dim hTable As Object
dim NorryLink As Hyperlink
Set html = New MSHTML.HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", NorryLink, False
.send
.html.body.innerHTML = .responseText
End With
' Set html = New MSHTML.HTMLDocument
' With CreateObject("MSXML2.XMLHTTP")
' Home - County of Northumberland
' .Open "GET", NorryLink, False
' .send
' html.body.innerHTML = .responseText
'End With
'Specify Email Items and Add Attachment
With EmailItem
.To = FinalResult
.Subject = Sheets("Tax Cert Bill").Range("B17").Value
.body = "Please find the PDF attachment"
.Attachments.Add TaxCertPDF
'.send
.Display
End With
Set EmailItem = Nothing
Set EmailApp = Nothing
as you can see i tried to work with different codes all give me error at .html.body.innerHTML = .responseText. why lots of ' but it has helped for all the other stuff i have been doing in this macro.
link to use Home - County of Northumberland
I'm trying to have it copy that page and add it to the body of the e-mail. i can not install stuff on this computer. but other then getting to copy page and put in e-mail i get it to other wise do as i need.
any help is greatly appreciated.
Dim EmailApp As Object
Dim EmailItem As Object
Dim myAttachments As Object
Dim mailAddress As String
Dim TaxCertPDF As String
Dim NorryLink As String
' Dim EMail As String
'Set Variables
Set EmailApp = CreateObject("Outlook.application")
Set EmailItem = EmailApp.CreateItem(0)
Set myAttachments = EmailItem.Attachments
' E-Mail Subject Parcel - Requestor - Date.pdf
TaxCertPDF = "T:\2022_TAX_CERTS\" & Sheets("Tax Cert Bill").Range("B17").Value & " - " & Sheets("Tax Cert Bill").Range("B12").Value & Format(Date, " - mm-dd-yyyy") & ".pdf"
NorryLink = "https://tax.norrycopa.net/taxclaim/trirsp2pp.asp?parcel=" & Sheets("Tax Cert Bill").Range("B17").Value
Dim FinalResult As Variant, Table_Range As Range, LookupValue As Range
Set Table_Range = Sheets("Requestor").Range("A:B")
Set LookupValue = Sheets("Tax Cert Bill").Range("B12")
FinalResult = Application.WorksheetFunction.VLookup(LookupValue, Table_Range, 2, False)
Dim html As MSHTML.HTMLDocument
dim hTable As Object
dim NorryLink As Hyperlink
Set html = New MSHTML.HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", NorryLink, False
.send
.html.body.innerHTML = .responseText
End With
' Set html = New MSHTML.HTMLDocument
' With CreateObject("MSXML2.XMLHTTP")
' Home - County of Northumberland
' .Open "GET", NorryLink, False
' .send
' html.body.innerHTML = .responseText
'End With
'Specify Email Items and Add Attachment
With EmailItem
.To = FinalResult
.Subject = Sheets("Tax Cert Bill").Range("B17").Value
.body = "Please find the PDF attachment"
.Attachments.Add TaxCertPDF
'.send
.Display
End With
Set EmailItem = Nothing
Set EmailApp = Nothing
as you can see i tried to work with different codes all give me error at .html.body.innerHTML = .responseText. why lots of ' but it has helped for all the other stuff i have been doing in this macro.
link to use Home - County of Northumberland
I'm trying to have it copy that page and add it to the body of the e-mail. i can not install stuff on this computer. but other then getting to copy page and put in e-mail i get it to other wise do as i need.
any help is greatly appreciated.