E
Ed
We work with a lot of engineering documents. Each doc has basically the
same general format, but specifics differ enough betweens sections that a
one-size-fits-all template isn't possible. I can pull all the info out of
the database to create the docs (this must be done through Word VBA; the
database itself isn't capable of doing this). Each report doc is created as
a plain text doc with no formatting.
What I'm trying to do now is figure out the creation of an index table (as
an Excel doc) that each section can customize. The info populating the
index table would be pulled from each report doc as it is created. But
each section's table will be different. For example, one section may want
the data in Blocks 10, 12, and 15A in their index, while Block 15A may not
even exist on another section's report. I'm trying to figure out how to let
one administrator from each section customize their index format - what they
want and how many data blocks they want to retrieve, rather than being the
one person to create an individualized index table for each section, and
customize it every time they change their mind!
I'm considering popping up a modeless UserForm that will allow the user to
select (in typical opened report) the headers of the blocks, the number of
spaces the retrieved data will span, and then enter a title for that data
field. For instance, if the report has
15A. TEMP: 13 deg C
the user can select
15A. TEMP: and click a button on the form, which will set that text as a
search string, then enter 8 spaces (for the retrieved data length) in a text
box, and then enter a title in another text box. All of this search info
could be written into a table saved in a doc associated with the UserForm,
and read back into strings in a Form_Initialize event. This would allow the
user to set up a table as big or small as desired. Then, when each report
doc is created, the code searches for the selected string, then extends the
range the specified number of spaces and selects that text to write into the
Excel table.
Does all this sound like a good way to go? Or am I doing things the hard
way? Is there a better way to consider?
Ed
same general format, but specifics differ enough betweens sections that a
one-size-fits-all template isn't possible. I can pull all the info out of
the database to create the docs (this must be done through Word VBA; the
database itself isn't capable of doing this). Each report doc is created as
a plain text doc with no formatting.
What I'm trying to do now is figure out the creation of an index table (as
an Excel doc) that each section can customize. The info populating the
index table would be pulled from each report doc as it is created. But
each section's table will be different. For example, one section may want
the data in Blocks 10, 12, and 15A in their index, while Block 15A may not
even exist on another section's report. I'm trying to figure out how to let
one administrator from each section customize their index format - what they
want and how many data blocks they want to retrieve, rather than being the
one person to create an individualized index table for each section, and
customize it every time they change their mind!
I'm considering popping up a modeless UserForm that will allow the user to
select (in typical opened report) the headers of the blocks, the number of
spaces the retrieved data will span, and then enter a title for that data
field. For instance, if the report has
15A. TEMP: 13 deg C
the user can select
15A. TEMP: and click a button on the form, which will set that text as a
search string, then enter 8 spaces (for the retrieved data length) in a text
box, and then enter a title in another text box. All of this search info
could be written into a table saved in a doc associated with the UserForm,
and read back into strings in a Form_Initialize event. This would allow the
user to set up a table as big or small as desired. Then, when each report
doc is created, the code searches for the selected string, then extends the
range the specified number of spaces and selects that text to write into the
Excel table.
Does all this sound like a good way to go? Or am I doing things the hard
way? Is there a better way to consider?
Ed