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 09-05-2007, 17:35
Manuel
Guest
 
Posts: n/a
Default Same Macro to all documents

I have a clipart that I use to compose layouts, I need to put the letter R in all of them, group, and close the document. What I plan to do is open all the documents in one category and apply the macro to all open documents. How do I reference all open documents?
Reply With Quote
  #2  
Old 09-05-2007, 17:35
Manuel
Guest
 
Posts: n/a
Default

Thanks in advance for any reply
Reply With Quote
  #3  
Old 09-05-2007, 17:59
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

how many documents have you got? if not too much you can put your R into clipboard (Ctrl-C), then use a VisualBasic macro recorder in Tools menu: CtrlV, CtrlA, CtrlG, CtrlS, CtrlF4, then stop recorder, assign a hotkey/button in Tools->options->customization->commands->macros
Reply With Quote
  #4  
Old 10-05-2007, 07:10
Manuel
Guest
 
Posts: n/a
Default Did it!

It wasn't that hard.
here's the code:

Code:
Sub AddRToElements()

    Dim s As ShapeRange, s1 As Shape
    Dim doc As Document
    
    For Each doc In Application.Documents
        Set s = doc.ActiveLayer.Shapes.All
        Set s1 = doc.ActiveLayer.CreateArtisticText(0, 0, "R", cdrEnglishUS, , "Arial", 24)
        s1.Outline.SetProperties 0.06, , CreateCMYKColor(0, 0, 0, 0), , , cdrTrue, cdrTrue
        s1.AlignToShapeRange cdrAlignHCenter + cdrAlignVCenter, s
        doc.ActiveLayer.Shapes.All.Group
        doc.Save
        doc.Close
    Next doc
    
End Sub
Reply With Quote
  #5  
Old 10-05-2007, 08:05
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

looks good :-)
Reply With Quote
  #6  
Old 10-05-2007, 14:30
Manuel
Guest
 
Posts: n/a
Default

Yes it works, it need to be done on a lot of files (over 200)
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
Cannot use Curveworks macros in a user witten macro??? jon46089 CurveWorks 2 02-03-2006 14:18
Help with Replace Macro Pumpkin_Masher Macros/Add-ons 1 21-09-2005 14:41
An Idea for a handy and easy to make macro vallentin Macros/Add-ons 2 16-03-2004 11:35
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 07:50
Speeding up a macro Rick Randall CorelDRAW/Corel DESIGNER VBA 2 12-12-2002 10:51


All times are GMT -5. The time now is 12:39.


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