Code: Select all
cell = sheet.getCellByPosition(0, 0)
cell.SetPropertyValue("HyperLinkURL", "http://www.google.ca")
Code: Select all
cell = sheet.getCellByPosition(0, 0)
cell.SetPropertyValue("HyperLinkURL", "http://www.google.ca")
Code: Select all
oTxt = oCell.getText()
Code: Select all
REM ***** BASIC *****
Sub Main
GlobalScope.BasicLibraries.loadLibrary("XrayTool")
sh = thisComponent.Sheets.getByIndex(0)
cell = sh.getCellByPosition(0,0)
'xray cell 'shows cell.Start, cell.End and cell.createTextCursor()
'both raise error "Property or method not found":
txtRange = cell.Start
cursor = cell.createTextCursor()
'xray cursor
End Sub
Code: Select all
str = cell.getString()
fld = doc.createInstance("com.sun.star.text.TextField.URL")
fld.setPropertyValue("URL", url);
fld.setPropertyValue("Representation", str);
# We are replacing the contents of the cell with exactly the same text,
# but storing it in the URL textfield with the same display value.
cell.setString("")
# You can only insert textfields via a text cursor, so we need to create one
txt = cell.getText()
txt.insertTextContent(txt.createTextCursor(), fld, False)
Code: Select all
fld = doc.createInstance("com.sun.star.text.TextField.URL")