dtpicker MicrosoftWord Template
Hello,
I am new to VB, but have general understanding of other programming languages.
I am trying to create a Microsoft Word Templete document which incorporates the dtpicker control. I would like the users to be able to select the date they made changes to the form. This form will be passed via email from rep to rep until all data is collected.
Problem:
1 - when a document is created from the templete and saved; Upon openning the document at a later date the date picker does not hold the value of the last date selected.
2 I tried using text box along with the date picker and some code behind to assign the value of the date picker to a text box upon date changed. Problem when this document is passed over email this functionality does not work for the recepient.
Is there a way to copy the code behind to each new document created?
Is there a way to make the dtpicker hold the date selected upon opening the document at a later date?
[993 byte] By [
MysTeek] at [2007-12-23]
No. The dtpicker is being added to the document as an embedded OLEObject
(activeX control) and there's nothing in Word that will retain the
setting. Similar problem with ComboBox and dropdown lists.
The setting has to be written somewhere, then reloaded when the document
is opened again. You can use an AutoClose and AutoOpen macro pair, or
the Document_Open and Document_Close events to do this, for example.
That this doesn't work on the recipients machines... Probably, their
macro security is set to "High". You'd need to digitally sign the VBA
project and instruct the recipients on how to add it to their "trusted
publishers". (See Tools/Macro/Security)
<<I am new to VB, but have general understanding of other programming
languages.
I am trying to create a Microsoft Word Templete document which
incorporates the dtpicker control. I would like the users to be able to
select the date they made changes to the form. This form will be passed
via email from rep to rep until all data is collected.
Problem:
1 - when a document is created from the templete and saved; Upon
openning the document at a later date the date picker does not hold the
value of the last date selected.
2 I tried using text box along with the date picker and some code
behind to assign the value of the date picker to a text box upon date
changed. Problem when this document is passed over email this
functionality does not work for the recepient.
Is there a way to copy the code behind to each new document created?
Is there a way to make the dtpicker hold the date selected upon opening
the document at a later date?>>
-- Cindy
Hello Cindy,
I know you know a lot more about ActiveX controls than myself, (you helped me out with an ActiveX control problem I was having recently) but I have written a program where I store values in textboxes in the following manner:
optHcopy.Value = ActiveDocument.Variables("Hcopy").Value (in the form initialise event)
and
ActiveDocument.Variables("LNIATA").Value = txtLNIATA.Text before leaving the document.
Can something like this be done by the chap above?
ChasAA
Hi Chas
Certainly, that's one possibility for storing the data - even the one I
would have suggested, had the OP followed up. The other "obvious"
possibility is document properties - the main difference being that
these are visible to the user AND can be accessed from a closed document
using DSOFile.
Of course, if the OP isn't willing to use document events there's a
problem...
-- Cindy