I have searched the forum and still have not found any real clear answer to my problem. I have a Microsoft word Document template that was created by one of our departments. I would like to have a notes form that is filled out and it populates the bookmark fields in the word document template. I know if I do the first field the rest should go easy, but the code to fill in that first field is stumping me. I have downloaded the redbook on domino designer and seen how to do it in excel, but not for a word document. Basically I would like a button that says generate report and all of the notes fields are placed on a new word document in the proper areas. Thanks in advance.
Subject: Microsoft Word Integration
Take a look here:
Regards
Axel
Subject: RE: Microsoft Word Integration
Below is the code I am using, but I am missing something. I think I need to set variables.
Sub Click(Source As Button)
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
'Open the document
objWord.Documents.Open "C:\Test.doc"
'Put the value in a field
objWord.ActiveDocument.FormFields("Name").Result = "Name"
objWord.ActiveDocument.FormFields("Address").Result = "Address"
'Lock the field
objWord.ActiveDocument.FormFields("Name").Enabled = False
objWord.ActiveDocument.FormFields("Address").Enabled = False
End Sub
I have a word document with two fields Name and Address. The Notes database form has those same two fields. I have an action button that when I click it opens the word document and places what ever is in the result =" xxxx ". But I want it to place the value of the field not what is in the " ". I am new to the script portion of Lotus and am trying to learn. Thanks
Subject: Microsoft Word Integration
I got it, just took some more looking:
objWord.ActiveDocument.FormFields(“Name”).Result = doc.Fname(0)