I need to save selected parts of a word file into another word file with watermark and header and then save to PDF
I already have this code that I merged on the internet, but it gives noo final error
I already have this code that I merged on the internet, but it gives noo final error
VBA Code:
Sub SaveCurrentPageAsANewDoc()
Dim xDoc As Document
Dim xNewDoc As Document
Dim xFileName As String
Dim xFolderPath As Variant
Dim xDlg As FileDialog
Dim Words As Object
Set xDoc = ActiveDocument
xFileName = InputBox("Enter file name here: ", "KuTools for Word")
If xFileName = "" Then Exit Sub
Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
If xDlg.Show = -1 Then
xFolderPath = xDlg.SelectedItems(1)
xDoc.Bookmarks("\Page").Range.Select
Selection.Copy
Set Words = CreateObject("Word.Application")
Words.Documents.Open "C:\Users\AVSPC03\Desktop\Produtos AVS word\Modelo1.docx"
Selection.Paste
Word.SaveAs xFolderPath & "\" & xFileName & ".PDF" (This part is wrong)
Words.Close
End If
End Sub