von DPunch » Fr, 06.05.2011 17:40
Aloha
Das würde in etwa so aussehen:
Code: Alles auswählen
oDoc = thisComponent
oSelection = oDoc.currentselection
oContentCells = oSelection.queryContentCells(5)
enumCells = oContentCells.Cells.createEnumeration
Do While enumCells.hasMoreElements
thisCell = enumCells.nextElement
If thisCell.TextFields.Count < 1 Then
sLink = thisCell.String
oField = oDoc.createInstance("com.sun.star.text.TextField.URL")
oField.URL = "http://worldwide.espacenet.com/searchResults?DB=EPODOC&locale=en_EP&query=" & sLink & "&ST=singleline&compact=false"
oField.Representation = "Suche in Espacenet"
oTextCursor = thisCell.Text.createTextCursor
thisCell.insertTextContent(oTextCursor,oField,True)
End If
Loop
Aloha
Das würde in etwa so aussehen:
[code] oDoc = thisComponent
oSelection = oDoc.currentselection
oContentCells = oSelection.queryContentCells(5)
enumCells = oContentCells.Cells.createEnumeration
Do While enumCells.hasMoreElements
thisCell = enumCells.nextElement
If thisCell.TextFields.Count < 1 Then
sLink = thisCell.String
oField = oDoc.createInstance("com.sun.star.text.TextField.URL")
oField.URL = "http://worldwide.espacenet.com/searchResults?DB=EPODOC&locale=en_EP&query=" & sLink & "&ST=singleline&compact=false"
oField.Representation = "Suche in Espacenet"
oTextCursor = thisCell.Text.createTextCursor
thisCell.insertTextContent(oTextCursor,oField,True)
End If
Loop[/code]