PdfAnnots Object


PdfAnnots is a collection of PdfAnnot objects. This object is returned by PdfPages' Annots property as well as PdfDocument's Form property.

Member List


Count As Long (Read-only)

Returns the number of items in the collection.

Item(Index As Long) As PdfAnnot (Read-only)

This is the default parameterized property. Returns a PdfAnnot object from the collection specified by a 1-based Index.


Function Add(Contents As String, Param As Variant, Optional Name, Optional Path) As PdfAnnot

Adds a new annotation to the collection. Returns a PdfAnnot object representing the newly created annotation.

Contents specifies the annotation contents, such as text displayed in a pop-up window when the annotation is opened.

Param is a parameter object or parameter string specifying the annotation type and other parameters.

Name specifies annotation-specific information

Path specifies a file path to be used with FileAttachment annotations and is ignored by all other annotation types.

The Add method is described in detail in Section 10.3.2 - Add Method Parameters.


Set Annot = Page.Annots.Add("Hello world", "type=text;x=10;y=400;width=100;height=50")

Sub Remove(Index As Long)
Removes an annotation specified by Index from the collection.