OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 16-08-2004, 14:58
Posts: n/a
Default Multiple Groups & Align Under

I have 30+ jpgs in a folder, each jpg is a picture of a person. The file name of the jpg is the name of the person in the picture.

I am trying to create a VBA macro that will import each image, create an artisitc text object below & centered under the picture using the filename as the text. I would like to group each set of imported picture and text. At the end I would have 30+ groups of pictures with the name of the person under the picture.

I have most of it below, but I can't seem to figure out how to group each image & text shape together. In the code below it groups all the images and all the text together.

I am also having trouble aligning the text centered and below the image.

Any help would be greatly appreciated.


Sub Macro1()

Dim sr As New ShapeRange

MyPath = "C:\jpg\"

FileName = Dir(MyPath)
Bottom = 0
mLeft = 0
FileNumber = 0
GroupNum = 0

Do While FileName <> "" ' Start the loop.

FileNumber = FileNumber + 2
FileName1 = MyPath & FileName
ActiveLayer.Import FileName1
ActiveShape.Name = FileName

'Create Name
Bottom = Bottom + 1
mLeft = mLeft + 1
ActiveLayer.CreateArtisticText mLeft, Bottom, FileName, Font:="Arial"
ActiveShape.Name = "Text" & FileName

' Align Name and Shape
ActiveLayer.Shapes(FileName).AlignToShape cdrAlignBottom, ActiveLayer.Shapes("Text" & FileName)

'Group Name and Shape
GroupNum = GroupNum + 1
sr.Add ActiveLayer.Shapes(FileName)
sr.Add ActiveLayer.Shapes("Text" & FileName)
Set GroupNum = sr.Group

FileName = Dir() ' Get next entry.
Reply With Quote

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
Multiple CDs installed on 1 PC geHucKa CorelDRAW/Corel DESIGNER VBA 1 08-04-2005 10:25
How? scanning multiple images Jerry Corel Photo-Paint VBA 1 03-10-2004 23:57
multiple addins (coreldraw 10) kelley CorelDRAW/Corel DESIGNER VBA 1 10-08-2004 16:56
CorelDraw 12's Align Mark CorelDRAW/Corel DESIGNER VBA 8 16-07-2004 17:24
Printing multiple copies sfldan CorelDRAW CS 0 21-08-2003 14:37

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

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