Search notes:

Examples for VBScript MS-Office App Creator: Word (simple)

This is one of the examples for the command line Office App Creator.

functions.bas

option explicit

sub main(projectRootDir as string) ' {

    selection.typeText "projectRootDir = " & projectRootDir

end sub ' }
Github repository VBS-MS-Office-App-Creator, path: /examples/Word/functions.bas

create.wsf

<job>
<script language="VBScript" src="..\..\create-MS-Office-app.vbs" />
<script language="VBScript">

   option explicit

   dim app
   dim doc

   set doc = createOfficeApp("word", currentDir() & "created.docm")
   if doc is nothing then ' {
      wscript.echo("Could not create word document")
      wscript.quit(-1)
   end if ' }

   set app = doc.application

   call insertModule(app, currentDir() & "functions.bas", "func", 1)

   call app.run("main", currentDir())

   doc.save

</script>
</job>
Github repository VBS-MS-Office-App-Creator, path: /examples/Word/create.wsf

See also

VBScript MS-Office App Creator

Index