![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Powershell & Corel Draw? CorelDRAW has a fairly extensive collection of VBA functions. Is there a way to import the methods exposed for VBA in Powershell? I recall in a DNR TV episode they used System.Reflection.Assembly to load a DLL and then use its methods. Can I do something similar with CorelDRAW's DLLs? CorelDRAW has lots of DLLs, is there a base library to start from? Thanks. __________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'. |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Powershell & Corel Draw? Barry S. wrote:
I can get something going quickly. It certainly sounds possible. What is likely happening is Corel's DLLs implement a COM interface, which PowerShell can usually interact with. There can be some problems though. On the other hand, the fact that System.Reflection.Assembly can be used would seem to indicate that it is a .NET library. In the latter case, PowerShell support would be more better. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Powershell & Corel Draw? Barry S. wrote:
You're right there: *lots* of DLLs!! I went searching on DNR TV and didn't notice anything related to Corel. I can't promise anything as it looks like I'd need to do a lot more searching. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Powershell & Corel Draw? On Nov 20, 1:41 am, Barry S. <n...@xxxxxx> wrote:
It might help somewhat to explain what it is you really want to do, but anyway I'd take an educated guess that you want to create vector drawings via powershell, and that you don't really want to extract the "functions" alone; if this is the case, Corel Draw supports OLE automation and built-in VBA scripting, much like the applications in the ms office suite. The one thing that Corel Draw doesn't appear to have though is a "primary interop assembly" which is a kind of middle- man layer that smooths the rough edges of COM and .NET interoperation. MSOffice provides PIAs which is why it's relatively easy to script Word and Excel etc with Powershell. Any application that supports this kind of scripting will usually end up exposing a rich COM api, which you may be able to get at. So.. what's next? I know that the file extension for corel draw files is .CDR - so the next thing I did was look up some information on this at http://filext.com/file-extension/CDR ; this tells me that the ProgIDs are: CDraw4 CorelDRAW.Graphic.8 CorelDRAW.Graphic.9 CorelDRAW.Graphic.10 CorelDRAW.Graphic.11 ProgIDs are kinda like aliases for COM objects. Next, typically you want to drop the number suffix and just use CorelDRAW.Graphic. This is usually aliased to the latest version. So, next step: ps> $cdr = new-object -COM CorelDRAW.Graphic hopefully this doesn't give an error, and if so, next thing is to try: ps> $cdr | get-member | more This will show all of the methods and properties on the Corel Draw object that you can manipulate to create your vector drawing. At this point, you can refer to your Corel VBA help to work out how to use these methods (cos I haven't got Corel installed). Hope this helps, - Oisin | ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Powershell & Corel Draw? On Wed, 21 Nov 2007 09:52:16 -0400, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote:
a DLL for use in powershell. (Nothing Corel specific.) Oisin Grehan: You nailed it. Treat as COM and refer to VBA reference. My goal is to see if I can automate a few common tasks.. (e.g. open file, insert text filename at x,y, insert vector graphic at x,y, export as jpg at a given resolution w/ custom compression settings. x 2000 files) Photopaint, the CorelDRAW eqivalent has a relatively simple scripting language (CorelScript) that works pretty well, but CorelDRAW has COM/VBA and I just get lost in the VBA details. Thanks guys. __________________ Note: To reply, replace the word 'spam' embedded in return address with 'mail'. | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Powershell & Corel Draw? I used to automate such tasks with Adobe's Photoshop though never started to do it in PowerShell. If you're familiar with Photoshop then you can find its scripting guide inside its installed folder under C:\Program Files\Adobe\Adobe Photoshop [version]\Scripting Guide. Photoshop's Scripting Guide supports COM scripting VBScript,JScript,AppleScript and has a help file for each scripting langauge as well as script examples. ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RE: Corel GuideMenu won't run | buddy | Vista installation & setup | 0 | 06-14-2008 07:35 AM |
| Corel 11 old updates | Peter R | Vista mail | 2 | 05-09-2008 12:17 AM |
| RE: Corel GuideMenu won't run | Aad den hartog | Vista installation & setup | 1 | 04-04-2008 04:57 PM |
| Corel Draw 12 setup problem | Jan Krohn | Vista General | 3 | 02-07-2007 05:22 AM |
| Corel Draw X3 won´t start | Santos | Vista General | 6 | 10-21-2006 01:38 PM |