Question
Wrong Stamp what ever AP value i use
Hi,
I found a piece of code on the internet, I'm trying to add a custom stamp on pdf with VBA.
It's working, I mean almost. Changing the property for Rect,Contents,Author or Name I can see the effect on my pdf. The only thing is, it always uses the Draft Stamp, nothing else whatever i pass in the AP property.
Any idea what i'm doing wrong?

Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim jso As Object
Dim stampRect(3) As Integer
Dim pageRect As Object
Dim annot As Object
Dim props As Object
Dim page As Object
Set gApp = CreateObject("AcroExch.App")
Set gPDDoc = CreateObject("AcroExch.PDDoc")
If gPDDoc.Open("whatever.pdf") Then
Set jso = gPDDoc.GetJSObject
Set page = gPDDoc.AcquirePage(0)
Set pageRect = page.GetSize
stampRect(0) = 100
stampRect(1) = 500
stampRect(2) = 400
stampRect(3) = 500
Set annot = jso.AddAnnot
Set props = annot.getprops
props.Type = "Stamp"
annot.setProps props
Set props = annot.getprops
props.ap = "Test2"
props.page = 0
props.rect = stampRect
annot.setProps props
End If
