dmikester1
Programmer
I recorded a macro in Word and collected the VBA code. I would like to convert it to VBScript so I can run it as a stand-alone script.
Here is the VBScript I wrote:
And the VBA I copied:
Can someone help me out?
Thanks
Mike
Here is the VBScript I wrote:
Code:
dim filesys, pathstring
set filesys=CreateObject("Scripting.FileSystemObject")
pathstring = filesys.GetAbsolutePathName("c:")
Msgbox pathstring
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open(pathstring & "\LOTO.rtf")
And the VBA I copied:
Code:
ActiveDocument.SaveAs FileName:="LOTO.txt", FileFormat:=wdFormatText, _
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False, Encoding:=1252, InsertLineBreaks:=False, AllowSubstitutions:=False _
, LineEnding:=wdCRLF
Can someone help me out?
Thanks
Mike