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 11-03-2007, 01:51
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Changing Outline width

Hello,

I want to change the width of all outlines from one particular width to another. I tried the following but got a runtime error (there was a problem in a property/method of this outline):

Code:
Sub Setlinethickness()

    Dim p As Page
    Dim s As Shape
    ActiveDocument.Unit = cdrMillimeter
    
    If ActiveDocument Is Nothing Then End
    
    For Each p In ActiveDocument.Pages
       For Each s In p.Shapes
           If s.Outline.Width = 0.353 Then
               s.Outline.Width = 0.4
           End If
       Next s
    Next p
    
End Sub
What have I done wrong and how can I make this work?

Thanks,

Chris (Hunt)
Reply With Quote
  #2  
Old 11-03-2007, 23:38
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
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 Works...

This seems to work just fine for me.

:-)
Shelby
Reply With Quote
  #3  
Old 12-03-2007, 09:26
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Chris,

Could it be that you have some invalid object that just can't have an outline (e.g. a bitmap or an OLE object) in your document that causes the problem?

You might want to check this first before trying to check/change the outline:

Code:
If s.CanHaveOutline Then
    If s.Outline.Width = 0.353 Then
...
Reply With Quote
  #4  
Old 12-03-2007, 11:23
knowbodynow knowbodynow is offline
Senior Member
 
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default

Thanks for the replies. I couldn't find anything about CanHaveOutline in VBA help. Is that only for X3? I'm using CorelDraw 12. I since tried "On Error Resume Next" and that seemed to get it working. Not sure it is a good idea, though.

Chris
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
Changing The Color and The Outline Width At The Same Time katrina63 New product ideas 1 22-06-2005 19:19
Default Outline Width Anonymous General 2 13-01-2005 15:25
CD 10, VBA not returning true outline width Webster CorelDRAW/Corel DESIGNER VBA 1 24-11-2004 17:09
Hairline width outline problems Steve CorelDRAW/Corel DESIGNER VBA 7 21-07-2004 18:24
Apply Outline - Scale with Image geopig CorelDRAW/Corel DESIGNER VBA 4 06-05-2004 07:23


All times are GMT -5. The time now is 20:24.


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