OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17-09-2003, 18:44
Steve
Guest
 
Posts: n/a
Default Read text into textboxes?

Hello

I've been trying to code an application that reads text from corel draw and places it into textboxes on a vb form. Heres the jist of what i had...

Code:
For Each g1 In ActiveSelection.Shapes

    If g1.Type = cdrTextShape Then

        Set t = g1.Text

        TempEdit.TextBox1.Value = t.Story

     End If

Next g1
I could'nt figure out how to read multiple text objects and "value" them into and equel number of textboxes.

Hope that made sense.

Thanks again!
________
HONDA INTEGRA DC5

Last edited by Steve; 12-03-2011 at 01:32.
Reply With Quote
  #2  
Old 20-09-2003, 05:11
jmp
Guest
 
Posts: n/a
Default

Hi Steve,

why not in the same textbox ? This way :

Code:
  TextBox1.MultiLine = True
  For Each g1 In ActiveSelection.Shapes
    If g1.Type = cdrTextShape Then
      Set t = g1.Text
      TextBox1.Value = TextBox1.Value & vbCrLf & t.Story
    End If
  Next g1
Hope this helps you somehow...

Jean-Marie
Reply With Quote
  #3  
Old 22-09-2003, 17:35
Steve
Guest
 
Posts: n/a
Default

Thanks JMP

I appreciate the help!

My application needs to later read from the text filled textboxes later in the program. I was recently considering creating the textboxes in the loop. If it finds text then it creates the textbox on the form and fills it with the found text. That's the only thing I can think of.

Any other ideas?

Thanks agian!!
Steve
________
Grape Ape Marijuana Strain

Last edited by Steve; 12-03-2011 at 01:32.
Reply With Quote
  #4  
Old 22-09-2003, 19:48
Steve
Guest
 
Posts: n/a
Default

Is there a way to index textboxes?
Code:
textbox(i)
or
Code:
control(i)
That would help

Thanks again!
________
X videos

Last edited by Steve; 12-03-2011 at 01:32.
Reply With Quote
  #5  
Old 23-09-2003, 10:25
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Quote:
Originally Posted by Steve
If it finds text then it creates the textbox on the form and fills it with the found text. That's the only thing I can think of.
Why not use a list box instead? It will have as many lines as you wish and you can scroll it up/down and later retrieve each line independently?
Reply With Quote
  #6  
Old 23-09-2003, 15:36
Steve
Guest
 
Posts: n/a
Default

Hi Alex

Long time..

Hopefully... my application reads the text in a design and puts it into a place (like a textbox) to be edited and the edited text would find and replace the text it found. Can I do that with a list box? Maybe via index numbers?

Thanks for your help.
________
Buy vaporizers

Last edited by Steve; 12-03-2011 at 01:32.
Reply With Quote
  #7  
Old 23-09-2003, 16:07
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Yes, you still can do that. Put a list box and a text box on a form. When you launch your macro, it goes through each text object, gets its text and puts it into the text box. Then the user can pick an entry from the list and it will be copied to the text box where the item can be edited. After everything is done, the edited text is replaced in the document.
Reply With Quote
  #8  
Old 23-09-2003, 16:59
Steve
Guest
 
Posts: n/a
Default

Perfect! My only problem is I'm having a hard time coding it. I'm trying to
Code:
s.text.replace listbox1.?, textbox1, false, , true
and having a problem. Any suggestions.

Thanks. This is a lot of help... again!
________
Toyota caldina history

Last edited by Steve; 12-03-2011 at 01:33.
Reply With Quote
  #9  
Old 23-09-2003, 19:20
Steve
Guest
 
Posts: n/a
Default

Perfect!!

I got it working. Thanks again for the clues.

This did create another problem though. How do I keep the list box from having more than one of any item. example:layered text is read as many times as is there. Any ideas?

Thanks!!
________
HONDA CB1100F

Last edited by Steve; 12-03-2011 at 01:33.
Reply With Quote
  #10  
Old 24-09-2003, 18:26
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default

Before adding a string to the list box, check if it is already in the list. If it is, just skip it. Should work...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text ENCODE Craig Tucker CorelDRAW/Corel DESIGNER VBA 10 26-01-2005 14:59
format text dialog box implement graphicdesigner CorelDRAW/Corel DESIGNER VBA 5 22-12-2004 14:37
Getting the center X on a text shape Rick Randall CorelDRAW/Corel DESIGNER VBA 4 03-08-2004 19:27
Reset text after text compression. Bellekom CorelDRAW/Corel DESIGNER VBA 2 05-05-2004 07:14
Placing a custom envelope on Text larrypanattoni CorelDRAW/Corel DESIGNER VBA 3 23-04-2003 10:18


All times are GMT -5. The time now is 03:58.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com