Search code examples
lotus-noteslotusscript

How do you call a Word method and pass parameters?


I want to get a word document and also use some of the parameters as documented in the MS docs at http://msdn.microsoft.com/en-us/library/office/aa220317%28v=office.11%29.aspx

I have no problem passing in the first argument, the file name but trying to add any of the other arguments seems to do nothing. What is the correct LotusScript syntax to pass in these arguments?

I tried the following with no result (it did open the document object however).

Set worddoc = word.Documents.Open( Dirname + "basedoc.doc", False, False, False, ,,, ,,, , True,, , , )

Solution

  • EDITED REPLACED CODE SAMPLE WITH ENTIRE WORKING AGENT:

    Option Public

    Option Declare

    Sub Initialize

    Dim filepath As String
    Dim wordDoc As Variant
    Dim word As Variant
    
    Set word = CreateObject("Word.Application")
    
    filepath="C:\test"
    Set wordDoc = word.Documents.Open(filePath &".doc", False, True, False)
    word.visible=True 
    

    End Sub

    This is working code, you will need a file named test.doc in the root of the c: drive for this to work, but this does work, I just ran it successfully, test with this and modify from there.