K
Ken Allen
This one is simply weird.
One of our divisions is sending out review documents asking for individuals
in other parts of the company to perform a review of changes to parts of our
system. To facilitate this process, they developed a WORD document that
contains a list of some of the features and links to internal files and web
pages that contain some of the changes. Sections that are changed were
identified with a red question mark.
To make it easier to track, they decided that they wanted to convert the
document to a form so the user could enter review information. To keep it
simple, they decided to replace the red question marks with a dropdown that
listed the review options (to be reviewed, accepted and rejected, for
example). The links were to be wrapped inside a MACROBUTTON so the reviewers
could double-click on them to open the link. A read-only text file was to be
added to the top of the document, and each of the dropdowns was to have an
exit macro that would count the number of dropdowns and thir state (which
entry was selected) and put the metrics in the read-only edit field. The
assumption was that the reviewers do not use templates, and so all of the
code must be within the document itself. To make things a bit more
complicated, the people writing the review document did not want to bother
with the 'form' until the last moment, so they wanted a macro that would
accept a document with the red question marks and hyperlinks and
automatically convert it to a form with the proper fields and macros.
I developed a ReviewDocument.dot template file that was to be used to
develop the initial WORD document. This template contains two macros: one is
a dummy for the exit handler on the dropdowns to be created; and one that
converts the document -- replaces the red question marks with dropdown
fields; enbeds the HYPERLINKS inside MACROBUTTON fields; creates a read-only
edit field centered at the head of the document; and creates the required
macros inside the document itself. For the most part this works, as the
(protected) document can be sent to some systems as a form document and it
works as expected.
When we send the document to some systems, however, we get an unexpected
error. I know about the macro enabling issue, and we are past that -- the
file does ask if the macros are to be enabled when we open it, and we select
"Yes".
The problem occurs when the user selects one of the dropdown fields and
changes an entry. On tabbing out of the field or clicking somewhere else in
the document, the VBE window is displayed with the code for the macro being
executed displayed and an error dialog indicating "Compile error: Can't find
project or library". The line of code being displayed is as shown below,
with the "Str" text highlighted.
szStatus = szStatus & vbCr & Trim(Str(iCountApproved)) & " entries are
approved."
We have reinstalled Office a couple of times, including the conversion
libraries, and nothing seems to resolve this problem.
Any thoughts?
-Ken
One of our divisions is sending out review documents asking for individuals
in other parts of the company to perform a review of changes to parts of our
system. To facilitate this process, they developed a WORD document that
contains a list of some of the features and links to internal files and web
pages that contain some of the changes. Sections that are changed were
identified with a red question mark.
To make it easier to track, they decided that they wanted to convert the
document to a form so the user could enter review information. To keep it
simple, they decided to replace the red question marks with a dropdown that
listed the review options (to be reviewed, accepted and rejected, for
example). The links were to be wrapped inside a MACROBUTTON so the reviewers
could double-click on them to open the link. A read-only text file was to be
added to the top of the document, and each of the dropdowns was to have an
exit macro that would count the number of dropdowns and thir state (which
entry was selected) and put the metrics in the read-only edit field. The
assumption was that the reviewers do not use templates, and so all of the
code must be within the document itself. To make things a bit more
complicated, the people writing the review document did not want to bother
with the 'form' until the last moment, so they wanted a macro that would
accept a document with the red question marks and hyperlinks and
automatically convert it to a form with the proper fields and macros.
I developed a ReviewDocument.dot template file that was to be used to
develop the initial WORD document. This template contains two macros: one is
a dummy for the exit handler on the dropdowns to be created; and one that
converts the document -- replaces the red question marks with dropdown
fields; enbeds the HYPERLINKS inside MACROBUTTON fields; creates a read-only
edit field centered at the head of the document; and creates the required
macros inside the document itself. For the most part this works, as the
(protected) document can be sent to some systems as a form document and it
works as expected.
When we send the document to some systems, however, we get an unexpected
error. I know about the macro enabling issue, and we are past that -- the
file does ask if the macros are to be enabled when we open it, and we select
"Yes".
The problem occurs when the user selects one of the dropdown fields and
changes an entry. On tabbing out of the field or clicking somewhere else in
the document, the VBE window is displayed with the code for the macro being
executed displayed and an error dialog indicating "Compile error: Can't find
project or library". The line of code being displayed is as shown below,
with the "Str" text highlighted.
szStatus = szStatus & vbCr & Trim(Str(iCountApproved)) & " entries are
approved."
We have reinstalled Office a couple of times, including the conversion
libraries, and nothing seems to resolve this problem.
Any thoughts?
-Ken