Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Changing annotations from within MS Access via VBA

$
0
0

I’m developing code (VBA) within MS Access to communicate with acrobat adobe. The purpose of this code is to change a particular annotation’s text and backcolor (for now). However, when I run the code the annotation property changes but it is not displayed properly. Only after I move annotation slightly then it gets refreshed (from within adobe pro). Is there a method I need to call before pddoc.save in order for it to save it correctly i.e. something similar to repaint in MS access ?

 

Dim pdDoc As Acrobat.AcroPDDoc

Dim pdPage As Acrobat.AcroPDPage

Dim pdAnnot As Acrobat.AcroPDAnnot

'

Set pdDoc = CreateObject("AcroExch.PDDoc")

pdDoc.Open ("c:\Temp\Test.pdf")

Set pdPage = pdDoc.AcquirePage(0) ' only have one page

Set pdAnnot = pdPage.GetAnnot(1) ' grab the first annotation,

pdAnnot.SetContents ("text goes here")

pdAnnot.SetColor (255) ' make it red

'

pdDoc.Save 1, "c:\Temp\Test.pdf"

pdDoc.Close

Set pdDoc = Nothing

 

BTW it works fine when the pdf is open while running the code.


Viewing all articles
Browse latest Browse all 10848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>