B
Bob
Hello All,
I've been given the task to create a kind of document viewer. The requirements are:
1. A file path & name will be passed to the application. (The file is simply a text file.)
2. The document view will have 3 columns.
3. Headers & Footers required.
4. Columns will be loaded with lines from the text file. (Lines will be loaded into one of the three columns based on codes in the file.)
5. Would like to use the free Word Viewer (WV) if at all possible, otherwise it will be word.
Since I am new to Word VBA I'm looking for advice on how to accomplish the task.
After my limited reading and internet searching I've come up with the following loosely defined plan:
1. From the host application, WV is called with a parameter of the text file name.
2. Upon startup, VBA code will size the page, create appropriate headers and footers and create a three column table. (The reason for using table
rather than just columns is because no snaking of columns is to be done. EG: If there are 160 lines destined for column1 it will be printed over 4
pages (assuming 50 lines per page). If there are only 35 lines in column2, it will be printed on the first page only. Having 403 lines in column3 it
will be spread across 9 pages.
3. VBA Code will read the text file populating the various table columns.
What do you think? Is there an easier way to get this done?
Thanks,
Bob
The layout of the data file is:
$1 <----------- this and following lines go to column 1
data line
data line
data line
data line
$2 <----------- this and following lines go to column 2
data line
data line
data line
data line
$3 <----------- this and following lines go to column 3
data line
data line
data line
eof
I've been given the task to create a kind of document viewer. The requirements are:
1. A file path & name will be passed to the application. (The file is simply a text file.)
2. The document view will have 3 columns.
3. Headers & Footers required.
4. Columns will be loaded with lines from the text file. (Lines will be loaded into one of the three columns based on codes in the file.)
5. Would like to use the free Word Viewer (WV) if at all possible, otherwise it will be word.
Since I am new to Word VBA I'm looking for advice on how to accomplish the task.
After my limited reading and internet searching I've come up with the following loosely defined plan:
1. From the host application, WV is called with a parameter of the text file name.
2. Upon startup, VBA code will size the page, create appropriate headers and footers and create a three column table. (The reason for using table
rather than just columns is because no snaking of columns is to be done. EG: If there are 160 lines destined for column1 it will be printed over 4
pages (assuming 50 lines per page). If there are only 35 lines in column2, it will be printed on the first page only. Having 403 lines in column3 it
will be spread across 9 pages.
3. VBA Code will read the text file populating the various table columns.
What do you think? Is there an easier way to get this done?
Thanks,
Bob
The layout of the data file is:
$1 <----------- this and following lines go to column 1
data line
data line
data line
data line
$2 <----------- this and following lines go to column 2
data line
data line
data line
data line
$3 <----------- this and following lines go to column 3
data line
data line
data line
eof