G
Gordon Bentley-Mix on news.microsoft.com
With the help of Greg Maxey, I'm working on a process to use an external data
source (a Word doc) to populate several ComboBoxes in a UserForm. The process
builds on the method described in
http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm, but loads the data
from the source into document variables before the UserForm is displayed and
uses these values to populate the ComboBoxes. (This stops the UserForm from
flickering when the source document is opened and closed - a real issue if
there are multiple ComboBoxes being populated.) All of this works great
(Thanks Greg!), but I want to take it one step further.
My templates contain functionality that allows the user to re-run the code
to modify the document after it's created. However, because the values for
populating the ComboBoxes already exist as document variables in the
document, it would be better if these values were reused. I can do this by
checking to see if the document is a new document or one that's being re-run.
If it's a re-run then I just use the values that are cached in the document
variables.
Unfortunately, this process doesn't take into account possible changes to
the data source since the document was intially created. I've found a way to
accomodate this by storing the last modified date of the data source used to
create the document in a document variable and checking this value against
the last modified date of the current data source.
However, this process requires the data source to be opened (to access the
"date last modified" built-in document property), and if the data source is
already open, there's really no advantage in not using it. What I'd really
like to do is check the last modified date *without* opening the data source.
I reckon this must be possible because Windows Exploder shows this date on
the properties sheet (and even when just hovering over the file). So how do I
get there from here?
--
Cheers!
Gordon Bentley-Mix
Word MVP
Please post all follow-ups to the newsgroup.
Read the original version of this post in the Office Discussion Groups - no
membership required!
source (a Word doc) to populate several ComboBoxes in a UserForm. The process
builds on the method described in
http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm, but loads the data
from the source into document variables before the UserForm is displayed and
uses these values to populate the ComboBoxes. (This stops the UserForm from
flickering when the source document is opened and closed - a real issue if
there are multiple ComboBoxes being populated.) All of this works great
(Thanks Greg!), but I want to take it one step further.
My templates contain functionality that allows the user to re-run the code
to modify the document after it's created. However, because the values for
populating the ComboBoxes already exist as document variables in the
document, it would be better if these values were reused. I can do this by
checking to see if the document is a new document or one that's being re-run.
If it's a re-run then I just use the values that are cached in the document
variables.
Unfortunately, this process doesn't take into account possible changes to
the data source since the document was intially created. I've found a way to
accomodate this by storing the last modified date of the data source used to
create the document in a document variable and checking this value against
the last modified date of the current data source.
However, this process requires the data source to be opened (to access the
"date last modified" built-in document property), and if the data source is
already open, there's really no advantage in not using it. What I'd really
like to do is check the last modified date *without* opening the data source.
I reckon this must be possible because Windows Exploder shows this date on
the properties sheet (and even when just hovering over the file). So how do I
get there from here?
--
Cheers!
Gordon Bentley-Mix
Word MVP
Please post all follow-ups to the newsgroup.
Read the original version of this post in the Office Discussion Groups - no
membership required!