word macro to do multiple conversions to txt

word macro to do multiple conversions to txt

Post by PeteRampso » Sat, 12 Feb 2005 09:44:25


I'm trying to figure out how this is done (Ive never written a word
macro before). I figured out how to populate an array with all of the
filenames in a directory, but can't figure out how to use that to open
each file and save it as a txt


thanks for any help
 
 
 

word macro to do multiple conversions to txt

Post by Lee Hanke » Sun, 20 Feb 2005 21:58:37


something along these lines:-

For i = 1 To filecount
Documents.Open FileName:=folderpath + filenames(i)
Documents(filenames(i)).SaveAs FileName:=filenames(i) +
extension,
FileFormat:=wdFormatText
Next i


--
Posted via Mailgate.ORG Server - http://www.yqcomputer.com/

 
 
 

word macro to do multiple conversions to txt

Post by Lee Hanke » Sun, 20 Feb 2005 22:19:08


Try something along these lines:-

For i = 1 To filecount
Documents.Open FileName:=folderpath + filenames(i)
Documents(filenames(i)).SaveAs FileName:=filenames(i) +
extension, FileFormat:=wdFormatText
Next i

where

filenames is an array of filenames starting at 1
filecount is the number of filenames in the array
folderpath is the path of the folder ending in a backslash
extension is the extension to add prefixed by a period e.g. .txt


--
Posted via Mailgate.ORG Server - http://www.yqcomputer.com/