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 18-07-2008, 13:28
nbmeist
Guest
 
Posts: n/a
Default Help With Powerclipping Multiple Bitmaps

Hello Everyone,
I recently started coding VBA into Corel, thank you all for the tons of information you supply.

With my latest project I have run into a stumbling block and would appreciate your help. I would like an InputBox to pop up, a file name be entered, have that powerclip into a rectangle on a template, then the InputBox pop up again and clip the next file entered into the next rectangle on the template until all rectangles are filled with Bitmaps.

Is this possible? I was able to write the code to get one image to clip into a rectangle of my choice, but am unsure how to make the process continue for multiple files.

I named my rectangles R1-R25, not sure if that is necessary or helpful.

Any help is greatly appreciated,
Nathan Burmeister

Code:
Sub Powerclip_Test()
     On Error GoTo ErrorHandler:
    Dim s As Shape, R1 As Shape, sr As ShapeRange
    Set R1 = ActivePage.FindShape(Name:="R1")
    
       Response = InputBox("Please Enter File Name To Be Imported From C:\SomeFolder\:")
      
       If Response = "" Then Exit Sub
       ActiveLayer.Import "C:SomeFolder\" & Response & ".tif", 772
       
       Set s = ActiveSelection
       s.AddToPowerClip R1
           
    Exit Sub
ErrorHandler:
    MsgBox ("File Not Found or Invalid File Format")
    End Sub
Reply With Quote
  #2  
Old 18-07-2008, 15:51
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
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 Almost there....

Just take what you have and wrap it in a loop like this:
Code:
Sub Powerclip_Test()
    On Error GoTo ErrorHandler:
    Dim s As Shape, R As Shape, sr As ShapeRange
    Dim i As Integer
    
    For i = 1 To 25
        Set R = ActivePage.FindShape(Name:="R" & i)
    
        Response = InputBox("Please Enter File Name To Be Imported From C:\SomeFolder\:")
      
        If Response = "" Then Exit Sub
        ActiveLayer.Import "C:\SomeFolder\" & Response & ".tif", 772
       
        Set s = ActiveSelection
        s.AddToPowerClip R
    Next i
           
    Exit Sub
ErrorHandler:
    MsgBox ("File Not Found or Invalid File Format")
    End Sub
It is great to have you here! And good luck.

-Shelby
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
Eyedropper on Bitmaps LaffRiot CorelDRAW/Corel DESIGNER VBA 1 25-06-2008 00:09
Bitmaps and cdrSWF knowbodynow CorelDRAW/Corel DESIGNER VBA 2 06-05-2008 22:58
Find bitmaps Wendy Hurst General 2 23-11-2007 15:40
Trace Bitmaps keytecstaff CorelDRAW/Corel DESIGNER VBA 5 24-05-2006 10:26
Powerclipping andyb CorelDRAW/Corel DESIGNER VBA 1 10-07-2003 20:05


All times are GMT -5. The time now is 03:00.


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