With

Assign multiple properties of an object.

Syntax 
      With object 
         [Statements]
      End with

Key
   object      A previously defined object variable

   Statements  Program code to be executed against object

Examples

Msg =  "First line" & vbCrLf & "Second line"
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
With objWord
.Documents.Add
.Selection.TypeText Msg
.Selection.WholeStory
End With

“We could have made beautiful music together” ~ Clifford Odets (movie: The General Died at Dawn)

Related VBScript commands

CreateObject - Create a WSH automation object.


 
Copyright © 1999-2024 SS64.com
Some rights reserved