From: spunkymuffmonkey on
Hi all,

I would like to know how to retrieve a value from a date/time picker that I
have inserted as an OLE Object into my document via this line:

ActiveDocument.Tables(iTableCount).Rows(1).Cells(2).Range. _
InlineShapes.AddOLEControl(ClassType:="MSComCtl2.DTPicker.2")

I cannot seem to fathom it out so any help would be appreciated!

Many thanks for looking
From: Fumei2 via OfficeKB.com on
Once a DTPicker is in the document it is listed as an object in the
ThisDocument code module. You can access all its events there.

To get the value use:

MsgBox ThisDocument.DTPicker1.Value

Obviously, if you have more than one, you have to use the correct number.

spunkymuffmonkey wrote:
>Hi all,
>
>I would like to know how to retrieve a value from a date/time picker that I
>have inserted as an OLE Object into my document via this line:
>
>ActiveDocument.Tables(iTableCount).Rows(1).Cells(2).Range. _
>InlineShapes.AddOLEControl(ClassType:="MSComCtl2.DTPicker.2")
>
>I cannot seem to fathom it out so any help would be appreciated!
>
>Many thanks for looking

--
Message posted via http://www.officekb.com

From: spunkymuffmonkey on
Once again, a million thanks for the reply and I didn't notice that the
object is listed in the this document picklist, instead I fed the variable
using the line:

dtmTable(i) = CDate(Left(CStr(oILS.OLEFormat.Object.Value), 10))

Which got what I want!

"Fumei2 via OfficeKB.com" wrote:

> Once a DTPicker is in the document it is listed as an object in the
> ThisDocument code module. You can access all its events there.
>
> To get the value use:
>
> MsgBox ThisDocument.DTPicker1.Value
>
> Obviously, if you have more than one, you have to use the correct number.
>
> spunkymuffmonkey wrote:
> >Hi all,
> >
> >I would like to know how to retrieve a value from a date/time picker that I
> >have inserted as an OLE Object into my document via this line:
> >
> >ActiveDocument.Tables(iTableCount).Rows(1).Cells(2).Range. _
> >InlineShapes.AddOLEControl(ClassType:="MSComCtl2.DTPicker.2")
> >
> >I cannot seem to fathom it out so any help would be appreciated!
> >
> >Many thanks for looking
>
> --
> Message posted via http://www.officekb.com
>
> .
>