I'm trying to insert a date into a label. I have written the following code. I can select a date by clicking on the arrow and the calendar pops up. The "CANCEL" button is working, but when I click "OK" I cannot get it to insert on the label. The label is a regular Corel document with text and images. I tried inserting a rectangle toolbox to see if I can get it to insert the date in there by using X,Y coordinates but that didn't work. I basically need to know how to insert DTPicker.Value onto the label.
DTPicker.Value
I've tried this : 1. Add a button on macro form 2. Select the rectangle 3. Click the button 4. Macro will read X, Y Pos of the rectangle, then create text and positioning it on the center of the rectangle.
Please see my post on stackOverflow for more details: http://stackoverflow.com/questions/32389241/coreldraw-x6-macro-to-insert-date-using-dtpicker-control/32502426#32502426. Thank you.
--------------------------
Private Sub OK_Click()
Dim sr As Shape Set sr = ActivePage.SelectableShapes.FindShapes.All
CorelDRAW.ActiveDocument.ReferencePoint = cdrCenter ActiveWindow.RulerOriginX = cdrCenter ActiveWindow.RulerOriginY = cdrCenter
ActiveDocument.ActiveLayer.Selected = True CorelDRAW.ActiveDocument.Unit = cdrInchSet sh = CorelDRAW.ActiveLayer.CreateArtisticText(0, 0, CStr(DTPicker1.Value)) MsgBox sh sh.PositionX = XPos sh.PositionY = YPos
'Unload MeEnd Sub