ComponentOne VSView 8.0
RetrieveTag Property

Returns a string containing the first tag found on a region of the current document.

Syntax

val$ = [form!]VSPrinter.RetrieveTag(Left As Variant, Top As Variant, [ Right As Variant ], [ Bottom As Variant ], [ Page As Variant ], [ ClientCoords As Variant ])

Remarks

Tags are pieces of hidden text in a document. They are created with the StartTag and EndTag methods, and may be used for a number of things, including document annotation, pop-up notes, hyperlinks, and more. The RetrieveTag property allows you to retrieve tags based on their position in the document. To search for tags based on their content, use the FindTag property instead. For details and examples about creating and using tags, see the Build a Table of Contents sample.

The parameters for the RetrieveTag property are described below:

Left, Top As Variant

These parameters define the left and top coordinates of the region to be searched for a tag. You may specify units with these parameters (inches, points, twips, cm, mm, or pixels). The default unit is twips. For details on using unit-aware measurements, see the Using Unit-Aware Properties topic.

Right, Bottom As Variant  (optional)

These parameters define the right and bottom coordinates of the region to be searched for a tag. They are optional, and default to the values of the Left and Top parameters (in which case the control looks for a tag that contains the given point).

Page As Variant  (optional)

This parameter defines the page to be searched for a tag. It is optional, and defaults to the current preview page (PreviewPage property).

ClientCoords As Variant  (optional)

This parameter determines whether the Left, Top, Right, and Bottom parameters express coordinates in client coordinates (as opposed to page coordinates). This parameter is optional and defaults to False (page coordinates). Note that you may convert coordinates using the ClientToPage and PageToClient methods.

The property returns the text of the tag, if it was found, or an empty string otherwise.

For example, the following code handles the MouseMove event to look for tags as displays them as tooltips if they are found:

Private Sub vp_MouseMove(Button As Integer, _

                 Shift As Integer, x As Single, y As Single)

 

  ' ** show tooltips if no button is being pressed

  If Button = 0 Then

 

    ' ** retrieve tag using mouse (client) coordinates

    vp.ToolTipText = vp.RetrieveTag(x, y, , , , True)

 

  End If

 

End Sub

Data Type

String

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback