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 20-07-2004, 09:58
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 Problem Printing Selected Only

In CorelDraw 12 I am trying to print my selected shape only. The code looks like this:

Code:
Set s = sr.ConvertToBitmapEx(cdrRGBColorImage, False, False, 300, cdrNoAntiAliasing, False)
s.CreateSelection
ActiveDocument.PrintSettings.PageRange = prnSelection
ActiveDocument.PrintOut
When I run the code I get the following error: Nothing is selected to be printed. Check your page range and/or color seperations settings.

Any ideas on how to make this work? I stole the code from the VBA recorder and the help file doesn't have anything under prnSelection. So I am not sure if this is the correct way to use it or not.

Thanks,

Shelby
Reply With Quote
  #2  
Old 20-07-2004, 11:03
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Problem Printing Selected Only

Hmm,

That is strange. I can't check this myself, but maybe try adding DoEvents after creating the selection. I'm not sure if this is going to help, but still worth giving a try...
Reply With Quote
  #3  
Old 20-07-2004, 14:20
Mark
Guest
 
Posts: n/a
Default Bug?

I had the same problem awhile back...just a bug in the vba i suppose..the print dialog box knows something is selected. It doesn't seem to matter what is selected either. I ended up copying it to another layer & toggling the two layers printable, printing the activedocument and then moving it back to its original layer. *sigh*
Reply With Quote
  #4  
Old 20-07-2004, 17:16
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 Looks like a bug

Well Alex I would have to say this is a bug. Would you like me to report it? Here is what I tried:

Code:
Set s = sr.ConvertToBitmapEx(cdrRGBColorImage, False, False, 300, cdrNormalAntiAliasing, False)
s.CreateSelection
DoEvents

ActiveDocument.PrintSettings.PageRange = 2
ActiveDocument.PrintSettings.ShowDialog
'ActiveDocument.PrintOut
I am not sure how the DoEvents works, so I don't know if that is the proper use or not.

I did add the ShowDialog to see what it said, and it shows no radial button being selected. (So that might be the problem)

Also I noticed when I was typing the line "ActiveDocument.PrintSettings.PageRange =" it does not give the choices of prnCurrentPage, prnPageRange, prnSelection, prnWholeDocument like I would expect.

I also tried changing to the numeric value of 2, just to see if that would work...and no luck. So I would have to say it is a bug, and simply doesn't work.

Shelby
Reply With Quote
  #5  
Old 20-07-2004, 19:30
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Looks like a bug

Shelby, are you sure that the recorder put ".PageRange = " in the recorded macro? Because this method is a string which takes the numbers of pages to be printed, such as:

Code:
ActiveDocument.PrintSettings.PageRange = "1,3,5-9"
to print pages 1, 3 and 5 through 9 only. However what you need is ".PrintRange = " instead:

Code:
ActiveDocument.PrintSettings.PrintRange=prnSelection
This should help...
Reply With Quote
  #6  
Old 20-07-2004, 20:06
Mark
Guest
 
Posts: n/a
Default Code

Changed my old code up..works great. Well Shelby at least I know I'm not the only one who made the same mistake. Welcome to the "We'll never be Alex" group.
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
Automate printing hernux CorelDRAW/Corel DESIGNER VBA 0 31-03-2005 21:39
Draw 12 : Printing Problem Hernán General 3 20-09-2004 10:54
Paste and Undo List problem Michael Cervantes Corel Photo-Paint VBA 5 11-09-2004 04:47
Problem with Export (or Save as) in AI-Format LOT CorelDRAW/Corel DESIGNER VBA 3 10-02-2004 14:28
Printing Mark CorelDRAW/Corel DESIGNER VBA 7 11-07-2003 17:02


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


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