returning a value from a date/time picker

S

spunkymuffmonkey

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
 
F

Fumei2 via OfficeKB.com

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.
 
S

spunkymuffmonkey

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top