Adding text box to PDF generated by Excel macro

2019-08-02 18:18发布

I have a macro to generate excel into PDF. How do i add text box in the PDF at a specific location?

Here are my codes:

Sub Export()
Dim wsA As Worksheet
Dim wsB As Workbook
Dim strPath As String
Dim myFile As Variant

Set wbA = ActiveWorkbook
Set wsA = ActiveWorksheey

strPath = wbA.Path
If strPath = "" Then
strPath = Application.DefaultFilePath
End If
strPath = strPath & "\"

myFile = Application.GetSaveAsFilename _
(FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")

If myFile <> "False" Then
wsa.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard,_
IncludeDocProperties:=True,_
IgnorePrintAreas:=False,_
OpenAfterPublish:=True

End If
End Sub

Thanks!

标签: excel vba pdf
0条回答
登录 后发表回答