Skip to content

Commit

Permalink
Update msword-helper.vbs
Browse files Browse the repository at this point in the history
Improved formatting and readability
  • Loading branch information
timbryandev authored Nov 27, 2020
1 parent bc42091 commit d2c767c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions msword-helper.vbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DIM wdFormat
DIM wdFormat, fileIn, fileOut

If Wscript.Arguments.Count > 1 Then
If Wscript.Arguments(1) = "" Then
Expand All @@ -9,21 +9,18 @@ If Wscript.Arguments.Count > 1 Then
End If


DIM fileIn
fileIn = WScript.Arguments(0)
DIM fileOut
fileOut = fileIn
fileOut = Left(fileOut, InstrRev(fileOut, ".")-1)
fileIn = WScript.Arguments(0)
fileOut = Left(fileIn, InstrRev(fileIn, ".")-1)

SET objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.Open(fileIn)

SET objDoc = objWord.ActiveDocument
objDoc.SaveAs fileOut, wdFormat

objDoc.Close
SET objDoc = Nothing

objWord.Quit

SET objDoc = Nothing
SET objWord = Nothing

0 comments on commit d2c767c

Please sign in to comment.