Thanks for your response bobsan42. Please see below...
I have a repetitive work of editing, finalizing word reports (daily), converting them to pdf, adding a signature field through adobe and sending them to supervisor for signature.
I want to know if there is a VBA program, which could be used to automate in order to save the word as .pdf and add the signature field automatically.
Any help appreciated. Thanks in advance.
The below is what I found from some thread for excel.
VBA Code:
Public Sub Save_Sheet_As_PDF_Add_Signature_Field()
Worksheets("Calc Sheet").Unprotect Password:=""
Dim PDDoc As Object
Dim AVDoc As Object
Dim JSO As Object
Dim formField As Object
Dim formField2 As Object
Dim inputPDFfile As String, outputPDFfile As String
Dim coords() As Variant
Dim coords2() As Variant
Dim filnam As String
filnam = Worksheets("Formulas").Range("V5") & " - " & Worksheets("Formulas").Range("V4") & " - " & Format(Date, "dd MMM yy")
' coordinates for QC signature
Const BOTTOM_LEFT_X = 315
Const BOTTOM_LEFT_Y = 50
Const WIDTH = 320
Const HEIGHT = 30
'Coordinates specifying position and size of the signature field's bounding rectangle, with origin (0,0) at bottom left of page,
'in the following order: top-left x, top-left y, bottom-right x and bottom-right y.
coords = Array(BOTTOM_LEFT_X, BOTTOM_LEFT_Y + HEIGHT, BOTTOM_LEFT_X + WIDTH, BOTTOM_LEFT_Y)
With ActiveSheet
inputPDFfile = ThisWorkbook.Path & "\Calc Sheets\delete\" & filnam & ".pdf"
outputPDFfile = ThisWorkbook.Path & "\Calc Sheets\" & filnam & " - " & " WSF.pdf"
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=inputPDFfile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End With
Set PDDoc = CreateObject("AcroExch.PDDoc")
Set AVDoc = CreateObject("AcroExch.AVDoc")
If PDDoc.Open(inputPDFfile) Then
Set JSO = PDDoc.GetJSObject
Set formField = JSO.AddField("SignatureField", "signature", 0, coords) '0 = 1st page
formField.StrokeColor = JSO.Color.Black 'StrokeColor sets the border and text colours of the field
If PDDoc.Save(1, outputPDFfile) Then
PDDoc.Close
AVDoc.Open outputPDFfile, vbNullString
AVDoc.BringToFront
AVDoc.Close True
Else
MsgBox "Unable to save: " & outputPDFfile
End If
End If
Kill inputPDFfile
Worksheets("Calc Sheet").Protect Password:=""
End Sub