Lotus notes 如何从Lotusscript在Word中写入activex控件?
我想使用Word文档作为模板来填充Notes数据。我用五个activex文本框创建了Word文件。有人举过如何使用Lotusscript访问这些文本框的例子吗Lotus notes 如何从Lotusscript在Word中写入activex控件?,lotus-notes,lotus-domino,lotusscript,Lotus Notes,Lotus Domino,Lotusscript,我想使用Word文档作为模板来填充Notes数据。我用五个activex文本框创建了Word文件。有人举过如何使用Lotusscript访问这些文本框的例子吗 MJ这不容易找到,但它就在这里 Sub Click(Source As Button) Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Dim doc As NotesDocument 'get Current NotesDoc Set uidoc
MJ这不容易找到,但它就在这里
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
'get Current NotesDoc
Set uidoc = workspace.CurrentDocument
Set doc =uidoc.Document
'get WordDocument
Dim wApp As Variant
Dim worddoc As Variant
Dim oTB As Variant
Set wApp=CreateObject("Word.Application")
wApp.Visible= True
Set worddoc= wApp.Documents.Add()
wApp.Visible = True
Call worddoc.InlineShapes.AddOLEControl ("Forms.TextBox.1")
'if you don't have the name off the TextBox1 let the system show you this with
'Msgbox ActiveDocument.InlineShapes(1).OLEFormat.Object.Name ,0, "title"
worddoc.TextBox1.Value ="Hello" 'or doc.field1(0)
End Sub
与您的示例不同的是,我创建了worddoc和文本框。
在你的情况下,你必须首先得到文件
Set wApps = CreateObject("word.application")
set worddoc = wApps.Documents.Open "C:\path-to-file\file.doc"
然后设置所有文本框的值
worddoc.TextBox1.Value ="Hello" 'or doc.field1(0)
worddoc.TextBox2.Value ="Hello" 'or doc.field1(0)
worddoc.TextBox3.Value ="Hello" 'or doc.field1(0)