Libreoffice - create relative hyperlinks for grid series

74 Views Asked by At

I have a grid that is set up as A1, A2, B1, B2, B3 etc. Rows run from A...Z and also AA to KG and the columns range from 1 to 1000.

Thanks to @Jim K in LibreOffice Draw -add hyperlinks based on query table we can add the hyperlinks from 1 to 1000 but I am not sure how to embed a second loop that does this?

I will be easiest if we could supply a CSV that has

A1, map_A1.pdf
A2, map_A2.pdf
FG89, map_FG89.pdf

This makes sure only the text we want is hyperlinked and it can deal with any complexity of file names. Match should be exact as well.

1

There are 1 best solutions below

1
On

To loop through letters, for example A to Z:

Sub chars_loop
    Dim cval, c
    For cval = Asc("A") to Asc("Z")
       c = Chr(cval)
       Print(c)
    Next cval
End Sub

As far as reading from a CSV file, there are two ways to read from files:

For an example of the latter, see Andrew Pitonyak's macro document section 5.13. You could loop through all lines in the file with Do While Not EOF(iNum).