OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 29-06-2003, 16:48
Posts: n/a
Default Find/Replace with CorelDraw 9 and VB 6

I'm new to Corel Draw and trying to do a find/replace on text in a cdr label. I'm able to open the label, but am having difficulties with the find/replace. I have tried some of the other methods in this forum, but just keep hitting a wall with Object doesn't support this property or method. (Yes, I have selected CorelDRAW 9.1 for Office Type Library). Are there other Corel libraries that I need, but don't have? Or am I just not doing this right?

Any help will be greatly appreciated!
Reply With Quote
Old 10-07-2003, 17:44
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: Find/Replace with CorelDraw 9 and VB 6

Originally Posted by sfldan
I'm able to open the label, but am having difficulties with the find/replace.
What do you mean by "label"? Is it an artistic text object? Paragraph Text? Something else?

If you want to replace some text strings inside text objects in CorelDRAW 9 document, here is how you do it:

Sub Test()
    Dim s As Shape
    For Each s In ActivePage.Shapes
        If s.Type = cdrTextShape Then
            s.Text.Replace "text", "object", True
        End If
    Next s
End Sub
This code for Draw 9 goes through each shape on the current page, and if this shape is a text object, it replaces string "text" with "object" using case-sensitive search.

So, if you have a text object with, say, "Some text" string in it, you'll end up with "Some object".

I hope this helps.
Reply With Quote

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
CorelDRAW 12 SP1 is available Alex CorelDRAW/Corel DESIGNER VBA 1 04-08-2004 01:43
Preview from CorelDRAW file and/or worksheet reanan CorelDRAW/Corel DESIGNER VBA 5 15-05-2003 18:29
Link in CorelDraw 11 met CorelDRAW/Corel DESIGNER VBA 0 25-03-2003 08:17
Creating macros for CorelDraw 10 in CorelDraw 11 Rick Randall CorelDRAW/Corel DESIGNER VBA 1 14-03-2003 08:00
CorelDRAW 11 and AddIn’s reanan CorelDRAW/Corel DESIGNER VBA 2 03-12-2002 14:21

All times are GMT -5. The time now is 15:06.

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