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 02-11-2009, 20:06
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default crash when trimming shapes - help please

Hi,
Can anyone help me out here.

I have a sub in a module that creates some shapes.
Another sub in the same module tries to access the shapes created by the first sub and seems to crash when I trim the shapes.
I named the shapes in the first sub so I could find them in the second sub.

The first sub runs and completes, then I have another form that pops up and the user can activate the 2nd sub (below).

Here's the code for the second sub:
Code:
Sub trimShadow()
    Dim s As Shape, s1 As Shape
    Dim sr As New ShapeRange
    Set s = ActivePage.FindShape(Name:="mainshape1")
    sr.Add s
    Set s1 = ActivePage.FindShape(Name:="offsetshape1")
    sr.Add s1
    sr(1).Trim sr(2), False, False
End Sub
Basically I want to access the shapes created by the first sub and trim them, but it seems to keep crashing corel x4

I'm pretty frustrated but I know there's gotta be a simple way to do this.

Thanks in advance.
-John
Reply With Quote
  #2  
Old 03-11-2009, 10:13
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi,
I think I got it.
I don't know why it crashes corel when both parameters of trim are set to false.

I had to set them both to true and delete the shapes later.

who knows...
Reply With Quote
  #3  
Old 04-11-2009, 12:19
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 11
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 Crash

I can confirm with the False, False it does crash, so as you said, I would just delete the shapes after the fact. Also, I don't think you need the ShapeRange, you could just do this:
Code:
Sub trimShadow()
    Dim s As Shape, s1 As Shape
    Set s = ActivePage.FindShape(Name:="mainshape1")
    Set s1 = ActivePage.FindShape(Name:="offsetshape1")
    s.Trim s1, True, True
End Sub
Best of luck,

-Shelby
Reply With Quote
  #4  
Old 04-11-2009, 12:30
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Thanks Shelby.

Yea. I was just trying every possible way. The weld crashed also.
It's these little bugs that can....well you know. lol.

-John
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
Trimming multiple objects in one swoop? jahmer General 1 17-11-2006 08:10
Trimming madhur General 0 03-09-2006 07:49
Imort Tif- X3 Crash gperzel General 5 19-07-2006 08:44
crash when exporting .eps's bloodgroove General 3 08-02-2006 14:25
crash lizrathke General 1 18-05-2005 18:59


All times are GMT -5. The time now is 05:45.


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