View Full Version : how to use pp11 comands in vba
i have no idea about programming. i'm trying to automate the following:
crop to mask, rotate 90 clockwise or counterclockwise, and auto equalize.
also no auto equalize and/or no rotate. so i guess i'm asking about 4 different scrips.
Here is a simple VBA macro for Corel Photo-Paint 11 that does exactly that - crop to mask, rotate by 90°, Auto Equalize. Replace 90 with "-90" to rotate clockwise.
Remove any corresponding line to create new macros which does only part of the job as you wish...
CorelScript.BitmapEffect "Auto Equalize", "AutoEqualizeEffect.V11"
if i knew how to put it into a macro and make it work would be even better. i have tried about 3-4 different ways to make a macro. and still it hasn't worked.
when i say, i have no backround in programming, i mean to say i have no idea how to use the ms vb segment that is in pp11.
when i paste your routine. i get all kinds of errors. it is asking me to define something. i have no idea what to define.
is this a macro? do i need to add some to the basic information that you gave me? do i need the quotes around the -90?
you can't imagine how i appreciate this help.
Here is what you need to do:
1. Start Photo-Paint
2. Hit Alt-F11 to launch VBA editor.
3. Press Ctrl-R to go to the Object Explorer window on the left side.
4. You should see two VBA projects aready there in Photo-Paint 11 - GlobalMacros, and HTMLSlideShow. Expand GlobalMacros until you reach "ThisDocument" module.
5. Double-click ThisDocument and it will bring up a code window where you can put your VBA code.
6. Copy the macro I posted above and paste it in the code module.
Now you have your macro. See the attached screenshot of VBA editor after I did all the steps above. You should see something very similar.
Now, to run the macro you can go back to Photo-Paint and in Tools>Visual Basic>Play dialog
Select "GlobalMacros (Corel PHOTO-PAINT11.gms) from the "Macros In" list and you should see all the macros in that module. Chances are you will have only one you just pasted - "Macro1" (See the second screenshot).
Just select it in the list and click Run. Don't forget to create a document and a mask in it, because your macro expects a document with a mask.
You can create more macros in the same module. Just follow the same rule and create more subroutine (you can name them pretty much whatever you want, it could be "Macro2", "Macro3", etc, or you can have more elaborate names such as "CropAndRotate". Just keep in mind that you can't use spaces or any other characters except for letters and digits.)
how can i thank you? it just the way you said. i'm not sure that i understand all the parts. but it did work. and i can't thank you enough.
now, that is one macro. every time that restart vba, i just get this one macro. i guess i must be ignorant or something. but it's just not getting through my skull.
next can i use a hot key for iach macro?
vBulletin® v3.8.1, Copyright ©2000-2013, Jelsoft Enterprises Ltd.