Skip to main content
Participant
December 1, 2016
Answered

Need VBA Code to Add Sticky Notes to PDF!!!Very Very Urgent Please

  • December 1, 2016
  • 2 replies
  • 2946 views

Hi Team,

Can Anyone provide the sample code to AddSticky Note Annot to Existing PDF File using VBA code using Acrobat SDK(JSObject).

Thanks

Mahesh

This topic has been closed for replies.
Correct answer maheshsayani

Hi Reinhard,

Sorry for the late Response.

Very Very Thanks for your Help..

It works more than my expectations.

One more time thanks for your help.

Thanks & Regards

Mahesh

2 replies

ReinhardF
Participating Frequently
December 1, 2016

Here a quick vbs/vba code. Have a look at the SDK and especially on the Acrobat JS API Reference to change it to your needs.

Good Luck, Reinhard

Path = "D:\Test.pdf"

Set App = CreateObject("Acroexch.app")
app.show
Set AVDoc = CreateObject("AcroExch.AVDoc")
Set AForm = CreateObject("AFormAut.App") 'from AFormAPI

If AVDoc.Open(Path,"") Then
    '// write some js code on a vbs variable
   js = "var annot = this.addAnnot({" &vblf _
    & "page: 0," &vblf _
    & "type: ""Text"", " &vblf _
    & "author: ""ReFran"", " &vblf _
    & "point: [100,500], " &vblf _
    & "contents: ""Call Smith to get help on this paragraph."", " &vblf _
    & "noteIcon: ""Help"" " &vblf _
    & "});"
  '//execute the js code
    AForm.Fields.ExecuteThisJavaScript js
end if

Set AForm = Nothing
Set AVDoc = Nothing
Set APP = Nothing

maheshsayaniAuthorCorrect answer
Participant
December 5, 2016

Hi Reinhard,

Sorry for the late Response.

Very Very Thanks for your Help..

It works more than my expectations.

One more time thanks for your help.

Thanks & Regards

Mahesh

Participating Frequently
April 8, 2020

Hi,

 

Could you please share a final code (script) which will add sticky note to PDF file ?

And also name, which .dll file is needed for this script (if any) ?

 

Thanks in advance,

 

BR

M.

Legend
December 1, 2016

I am sorry to report that programming with the Acrobat SDK is not about finding samples to copy/paste for your needs. Instead, it is about studying the thousands of pages of documentation and writing all the code yourself.