Prev Link |
ExcelExplorer Manual |
Next Target |
 |
(ExcelExplorer 4.0)
Get anchor for the URL string (symbols after # sign) or link within workbook.
false EEData TextMark( )
Parameters
- None
Description
Text mark is an anchor for the URL string (symbols after # sign) or link within workbook.
This method can returns FALSE if no text mark found for the link.
Otherwise returns EEData object.
You should always check returned value if it valid object in order to use its methods.
Worksheet used in the example below:
 |
A |
B |
C |
| 1 |
|
|
|
| 2 |
|
http://www.google.com/ |
|
| 3 |
|
C:\AUTOEXEC.BAT |
|
| 4 |
|
..\..\file.txt |
|
| 5 |
|
mailto:example@example.com?subject=Subject |
|
| 6 |
|
Sheet1!A1 |
|
| 7 |
|
file.xls#Sheet1!A1 |
|
| 8 |
|
\\server\share\file.txt |
|
| 9 |
|
|
|
Print full link URLs
<?php
$area = $ee->Worksheet(0)->UsedArea();
if( $area !== false ) {
for( $col = $area->FirstColumn(); $col <= $area->LastColumn(); $col++ ) {
for( $row = $area->FirstRow(); $row <= $area->LastRow(); $row++ ) {
$link = $ee->Cell(0,$col,$row)->Link();
if( $link !== false ) {
echo 'Link in column '.$col.', row '.$row.': ';
echo $link->Link()->UTF8();
if( $link->TextMark() ) {
echo '#'.$link->TextMark()->UTF8();
}
echo "\n";
}
}
}
}
?>
Will output: Link in column 1, row 1: http://www.google.com/
Link in column 1, row 2: C:\AUTOEXEC.BAT
Link in column 1, row 3: ../../file.txt
Link in column 1, row 4: mailto:example@example.com?subject=Subject
Link in column 1, row 5: #Sheet1!A1
Link in column 1, row 6: file.xls#Sheet1!A1
Link in column 1, row 7: \\server\share\file.txt
|