I want to Convert HTML to PDF, So I use VBA invoke. But it shows this error Why? Thanks in Advance

Hi @arunkumarcasper

Is it possible to look at the entire code. It seems like the PDFDocument type its unable to understand from Line 5

@arunkumarcasper

Check if the namespace windows.data.pdf is imported or not

You can tey using like this windows.Data.Pdf.PdfDocument

Cheers

Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter()
Dim htmlText As String = InputHtmlText
Dim baseUrl As String = “E:\Government VIDEOS”
Dim document As PdfDocument = htmlConverter.Convert(htmlText, baseUrl)
document.Save(“Output.pdf”)
document.Close(True)

Sorry to ask iam not able to see this Namespace
image

Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter()
Dim htmlText As String = InputHtmlText
Dim baseUrl As String = “E:\Government VIDEOS”
Dim document As PdfDocument = htmlConverter.Convert(htmlText, baseUrl)
document.Save(“Output.pdf”)
document.Close(True)