您好,我正在尝试创建 LO 基本宏,用于添加带有文本字段的文本,并将一些文本放入文本字段,如下所示:
If l>2 Then
'not first time, insert file after Doc5
oText = Doc4.getText()
oText2 = oText
oText.insertString( oText.End, oText2, False ) 'THIS IS NOT WORKING
oText.insertObject( oText.End, oText2, False ) 'THIS IS NOT WORKING
Else
Doc5 = StarDesktop.loadComponentFromURL(file1, "_hidden", 0, Dummy) 'open copied file
Doc4 = Doc5
End If
oForm = Doc5.Drawpage.Forms.getByName("Form") 'Get Form'
oField = oForm.getByName("Textfield 1") 'Get access to field'
oField.Text = "some text..."
'Change name to text field, there is no need to use it any more, and new page in next round will have the textfield 1 -name
oField.Name = "Textfield" & Cstr(l)
l=l+1
有帮助吗?关注尤哈