We then create an instance of Microsoft Word, and use the Open method to open the file C:\Scripts\MyLog.doc. We start off by creating a constant named wdFormatText and assigning it the value 2 this constant will be used to tell Word we want our new file saved as a text file. ObjDoc.SaveAs “c:\scripts\mylog.txt”, wdFormatText Set objWord = CreateObject(“Word.Application”) In fact, you can do it using this script: Const wdFormatText = 2 And you can do the very same thing using a script. Within Word, you can do a File – Save As and save a Word document as a text file. Yes, you can do this quite easily with a script in fact, with very few exceptions anything you can do within a Microsoft Office program you can do by using a script. Is there a way to do that using a script? I would like to open each of these files and save them as plain-text files. Hey, Scripting Guy! I have a series of Word files.
0 Comments
Leave a Reply. |