需要帮助使用 Libre Office writer 添加带有文本字段的文本

需要帮助使用 Libre Office writer 添加带有文本字段的文本

您好,我正在尝试创建 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

有帮助吗?关注尤哈

答案1

请检查这里查看这里这里。我希望这些链接会对您有所帮助。

相关内容