![]() |
#1
|
||||
|
||||
![]()
Quick question...
I have this... Dim S as Shape Set S = ActiveLayer.Shapes.FindShape("test") S.Text.Story = Textbox1.Value In my .cdr file I have an artist text thats labeled test in the object data manager... if I open a form and type something in the text box... it types whats in the text box, in my artist text in the .cdr file - I got this part down no problem... NOW... the question is, how can I do that in reverse? When I open the form (script under userform_initialize), it looks to see what the artistic text is (in object data "test") and fills it in as the value in textbox1 in the form ... is this possible? |
#2
|
||||
|
||||
![]()
there are form's events Initialize and other: in the form's code view select first combobox just above the code pane, select UserForm (now an empty sub appears), immediately choose Initialize event in the second nearby combobox - now you have the UserForm_Initialize() event. Type the assignments there
|
#3
|
||||
|
||||
![]()
hi os, I got that part... the part I need is "reading" the artistic text in my document, and inserting it into the textbox1.value when the form starts.
I can make it insert text into my corel file from the textbox1 in the form, but I need to do the reverse... using the object data name I want to find a particular peice of artistic text in my corel file, and upon opening my userform it populates textbox1.value with the artist text I found in the corel file using "object data" I have "templates" set up that I use a userform I made, to fill in a number of items in my template/corel file. What I now want it to do is, if I save the template/corel file and open it at a later date... upon starting the userform, it populates all the text fields using the data that is already in my saved corel file... so I can modify or erase using the form, rather then doing it in the corel file itself! |
#4
|
||||
|
||||
![]()
I assume you use some shape iteration to find a shape with the data field required when you tranfser the text from the form.
Code:
sub userform_Initialize() dim sh as shape for each sh in activePage.FindShapes(,cdrTextShape) if sh.DataBlabla... then 'FOUND 1 textbox1=sh.Text.Story.Text elseif blabla2 ' FOUND 2 textbox2=sh.Text.Story.Text ...... endif next end sub |
#5
|
||||
|
||||
![]()
Hi Os,
I modified slightly and came up with this and it works! Code:
Private Sub userform_Initialize() Dim S As Shape Set S = ActiveLayer.Shapes.FindShape("doctext", cdrTextShape) TextBox1 = S.Text.Story.Text End Sub Appreciate the help! B |
#6
|
||||
|
||||
![]()
yeah, these text properties are somewhat tricky, yet powerful :-)
btw, paying tribute to my obsession with optimizations and error checking: Code:
Private Sub userform_Initialize() on error resume next TextBox1 = ActiveLayer.FindShape("doctext", cdrTextShape).Text.Story.Text End Sub |
#7
|
||||
|
||||
![]() Quote:
![]() the in house IT guy checks in occasionally and looks at my work... and although he has a limited knowledge as well (light years head of mine) he just shakes his head when he see's the code in my scripts! hahaha thanks again! B |
#8
|
||||
|
||||
![]()
:-)
it's ok, I've just had a chance to feed my demon |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
adding jpg to textbox | donjuan | CorelDRAW/Corel DESIGNER VBA | 1 | 21-08-2006 22:03 |