This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
WP Get links

WP Get links 


 

WP Get links ( targetObj ) -> Function result 
Parameter Type   Description
targetObj  Object in Range or element or 4D Write Pro document
Function result  Collection in Collection of links

The WP Get links command returns the collection of all links defined in targetObj.

In the targetObj parameter, you can pass:

  • a range, or
  • an element (table / row / paragraph / body / header / footer / section / subsection / text box), or
  • a 4D Write Pro document

Returned value

WP Get links returns a collection of link objects, each of them containing one or more of the following properties:

PropertyTypeDescriptionAvailable for
[ ].urlTextLink's target contentsurl links
[ ].methodTextLink's method namemethod links
[ ].parameterText | NumberUser parameter value passed to the linkmethod links (if used)
[ ].bookmarkTextBookmark name for the linkbookmark links
[ ].rangeObjectRange of the link's label. See Range handling commandsall links

Example  

You want to change the color of all url link labels in a 4D Write Pro document:

 C_COLLECTION($links)
 C_OBJECT($link)
 
 $links:=WP Get links(myDoc)
 
 For each($link;$links)
    If($link.url#Null//it's a url link
       WP SET ATTRIBUTES($link.range;wk text color;"red")
    End if
 End for each



See also 

Blog: Links in 4D Write Pro documents
WP Get formulas
WP SET LINK

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language
Number: 1643

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R5

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v20 R7)