I want to create a number of text files using VBA.
Each file will have a particular header eg "UK News", "USA News" "Irish News"
The files will be created as Word documents and stored in a folder C:\inbound
The text files need to be created in a folder called C:\outbound
(The files need to saved as unicode text files)
The input file names will be: UK.doc, usa.doc, ireland.doc
Output file names need to have a prefix eg UKddmmyy.txt, USddmmyy.txt
I thought it might work to have these variables stored in cells in a Excel spreadsheet - and then we can modify them as our need changes.
Variables:
Headers: File name Prefixes:
UK News UK
USA News USA
Irish News IE
Could anyone advise how we could use VBA to input the headers into each file, and then save them with correct names. I presume some form of loops/arrays will be needed but am not that good with these !
Many thanks
Mat
Each file will have a particular header eg "UK News", "USA News" "Irish News"
The files will be created as Word documents and stored in a folder C:\inbound
The text files need to be created in a folder called C:\outbound
(The files need to saved as unicode text files)
The input file names will be: UK.doc, usa.doc, ireland.doc
Output file names need to have a prefix eg UKddmmyy.txt, USddmmyy.txt
I thought it might work to have these variables stored in cells in a Excel spreadsheet - and then we can modify them as our need changes.
Variables:
Headers: File name Prefixes:
UK News UK
USA News USA
Irish News IE
Could anyone advise how we could use VBA to input the headers into each file, and then save them with correct names. I presume some form of loops/arrays will be needed but am not that good with these !
Many thanks
Mat