ComponentOne VSView 8.0
StartTag Method

Starts the definition of a document tag (for later use with the FindTag and RetrieveTag methods).

Syntax

[form!]VSPrinter.StartTag Text As String, [ Left As Variant ], [ Top As Variant ], [ Right As Variant ], [ Bottom 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. For details and examples about creating and using tags, see the Build an Index sample.

The parameters for the StartTag method are described below:

Text As String

This parameter contains the tag's text. You can later look for a tag based on this value using the FindTag property, or retrieve this value based on the tag's position using the RetrieveTag property.

Left, Top, Right, Bottom As Variant  (optional)

These parameters are optional. If supplied, they define a rectangle on the page that is associated with the tag. If omitted, the tag will include all text and graphical elements up to the next call to the EndTag method.

For example, the following code creates several tags, and uses their text as a tooltip when the mouse moves over an element on the document:

' ** create document with tags

Sub CreateDoc()

  With vp

  .StartDoc

 

  ' ** create tags based on document elements

  .StartTag "This is a picture of a horse."

  .DrawPicture picHorse, "2in", "3in", "2in", "2in"

  .EndTag

 

  .StartTag "These are some text and pictures."

  .DrawPicture picHorse, "2in", "3in", "2in", "2in"

  .Paragraph = "Horse"

  .DrawPicture picDog, "4in", "3in", "2in", "2in"

  .Paragraph = "Dog"

  .DrawPicture picCat, "4in", "3in", "2in", "2in"

  .Paragraph = "Cat"

  .EndTag

 

  ' ** create a tag based on a region

  .StartTag "This is the rectangle from (1in, 1in)-(5in,2in)", _

            "1in", "1in", "5in", "2in"

  .EndTag

  .EndDoc

  End With

End Sub

 

' ** show tags as tooltips

Private Sub vp_MouseMove(Button As Integer, Shift As Integer, _

                         x As Single, y As Single)

  If Button = 0 Then

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

  End If

End Sub

 

 


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

Product Support Forum  |  Documentation Feedback