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 28-01-2008, 09:18
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default X4:s1.PlaceTextInside itm1 broken

In this small bit of code, I am placing a string of text inside of an existing object. It works in X3, but fails in X4. "s1.PlaceTextInside itm1" returns an "Object variable or with block variable not set" error.

An ideas for a work around. I'm sure it has something to do with the new layer structure.
Code:
    If ItemDesc1.Text > "" Then
        Dim itm1 As Shape
        Dim s1 As Shape
        Set s1 = ActivePage.FindShape("GARMENT")
        Set itm1 = ActiveLayer.CreateParagraphText(0, 0, 1, 1, ItemDesc1, cdrEnglishUS, , "Tahoma", 10)
        s1.PlaceTextInside itm1
    End If
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.

Last edited by ddonnahoe; 28-01-2008 at 10:13.
Reply With Quote
  #2  
Old 28-01-2008, 17:09
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Works for me...

I rewrote it like this and it works fine. My suggestion is seeing what is being assigned to your ItemDesc1 variable.
Code:
Sub TextInside()
    Dim s As Shape
    Dim s1 As Shape
    Dim ItemDesc1 As String
    
    ItemDesc1 = "My Text"
    
    Set s1 = ActivePage.FindShape("GARMENT")
    Set s = ActiveLayer.CreateParagraphText(0, 0, 1, 1, ItemDesc1, cdrEnglishUS, , "Arial Black", 24)
    s1.PlaceTextInside s
End Sub
-Shelby
Reply With Quote
  #3  
Old 29-01-2008, 08:24
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

ItemDesc1 is a control(TextBox) from my form. I am using the text from it to place inside the named object.
Code:
If ItemDesc1.Text > "" Then
        Dim itm1 As Shape
        Dim s1 As Shape
        Dim itmid As String
        
        itmid = ItemDesc1.Text
        Set s1 = ActivePage.FindShape("GARMENT")
        Set itm1 = ActiveLayer.CreateParagraphText(0, 0, 1, 1, itmid, cdrEnglishUS, , "Tahoma", 10)
        'Set itm1 = ActiveLayer.CreateArtisticText(0, 0, itmid, cdrEnglishUS, , "Tahoma", 10)
        s1.PlaceTextInside itm1
End If
Even if I change the code to assign the text to a string variable, I get the same error.

----------------
Now playing on Pandora: Saturated Fatty - On The Horizon
via FoxyTunes
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #4  
Old 29-01-2008, 08:31
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Fixed it. changed ActivePage.FindShape to ActiveLayer...
Code:
If ItemDesc1.Text > "" Then
        Dim itm1 As Shape
        Dim s1 As Shape
        Dim itmid As String
        
        itmid = ItemDesc1.Text
        Set s1 = ActiveLayer.FindShape("GARMENT") ' changed to ActiveLayer.FindShape...
        Set itm1 = ActiveLayer.CreateParagraphText(0, 0, 1, 1, itmid, cdrEnglishUS, , "Tahoma", 10)
        s1.PlaceTextInside itm1
End If
It seems that the ActivePage function in X4 VBA is broken. I have reported this to Corel.

----------------
Now playing on Pandora: Saturated Fatty - On The Horizon
via FoxyTunes
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
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
ActiveView.OriginX is broken???? jemmyell CorelDRAW/Corel DESIGNER VBA 2 24-01-2005 20:09


All times are GMT -5. The time now is 23:31.


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