Domino Code Fragment

Code Name*
Open word and run one of the Macros.
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.219.189.247
Description*
Opens Resume.doc on c:\ and runs a macro called macro1.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Simply transcribe the VB code into LotusScript code and it should work as long as you define an object handle of type word.

Either way I did the following in about 5 minutes so it is easy once you get the idea.

First I copied my resume.doc to c:\

Then I set record Macro to on and  openned Resume.doc and spell checked the document.

I saved the Macro as Macro1

Then I closed word.  I opened Word again and recorded another Macro.

In this macro I ran Macro1 to see how the code worked.

Then I stopped recording and saved this macro as Macro2.

Next I went and edited Macro2 to see the VB code.

I copied both the macro1 code and the macro2 code and created the following in an action button in Notes.

You will note that the LotusScript code needed some tweaking ;-)

Now clicking on the action button opens Resume.Doc and runs spell checker.

Just too cool.

Sub Click(Source As Button)
' This procedure is a brief sample showing how to automate Word.
   
  ' Get a reference to the Word Application object.
    Set appWord = CreateObject("Word.Application")
   
  ' Display the application.
    appWord.Visible = True
   
  ' Open a sample document.
    appWord.Documents.Open("C:\Resume.doc")


  ' Run Macro1  
    appWord.Run("Macro1")
   
    Msgbox "At this point Word is open and displays a document and spell checks it. The following statements will close the document and then close Word."
   
  ' Quit Word.
    appWord.Quit
   
  ' Close the object variable.
    Set appWord = Nothing
   
End Sub