OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2006, 10:59
jfelder
Guest
 
Posts: n/a
Default Using Macros to Export to Gif and/or EPS

I am really new to VB/Macros and Corel for that matter. I would like to create a Macro/Button to streamline the Export to GIF and EPS. I have seen the Export macro but that is for exporting several as a batch. I would like something similar to Photoshop actions where I can just click a button or a keystroke and it exports with my settings as either eps or gif. I need to do this with each separate file, not as a batch to several.

Thank You.
Jim
Reply With Quote
  #2  
Old 02-06-2006, 03:49
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

read this thread - http://forum.oberonplace.com/showpos...59&postcount=1

Code:
Sub exportX()
    Dim expflt As ExportFilter
    Dim pal As StructPaletteOptions
    set pal=Application.CreateStructPaletteOptions
    With pal
        .PaletteType = cdrPaletteOptimized
        .NumColors = 32
        .Smoothing = 0
        .DitherType = cdrDitherNone
        .ColorSensitive = False
    End With
    Set expflt = ActiveDocument.ExportBitmap(ActiveDocument.Name+".gif", cdrGIF, cdrSelection, cdrPalettedImage, 225, 225, 72, 72, cdrNormalAntiAliasing, False, False, False, False, cdrCompressionLZW, pal)
    With expflt
        .Interlaced = False
        .Transparency = 0 ' FilterGIFLib.gifNone
        .InvertMask = False
        .ColorIndex = 1
        .Finish
    End With
 
End Sub
tune the settings using class explorer (F2) help in VBA editor for ExportBitmap and StructPaletteOptions - just click the word in code, right-click and choose "Definition" to lookup quick-help, or press F1 to see detailed article
Reply With Quote
  #3  
Old 02-06-2006, 08:48
jfelder
Guest
 
Posts: n/a
Default Macros

I really appreciate your reply. I will try to figure this out based on what you gave me. My problem is that I don't know this code at all. I have tried to use the create Macro feature in Corel to create this macro for what I need. It's just not very easy. I am so used to Actions in Photoshop. I thought if I could just record my keystrokes and mouse clicks I would be good to go.

I appreciate the code but the fact that I don't know how you did this I don't feel comfortable with editing or changing it if I need to. I also am not quite sure where to even put this code.

Thank you.
Jim Felder
Reply With Quote
  #4  
Old 02-06-2006, 09:11
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

find an hour and quick read VBA documentation shipped with CorelDraw, nothing weird, just a standard VBA built-in in hunderd apps....

check also Alex's great hints & tips & quick tutorials on VBA:http://oberonplace.com/vba/index.htm

1.create new GMS http://oberonplace.com/vba/newgms.htm
2.CorelDraw-menu->Tools->VisualBasic->Editor, find in projects your new gms - it will have a name "GlobalMacros (YourGMSname.gms)", rename it in properties pane (F4), right click renamed project in Projects pane, choose Insert->Module then paste that text
3.then Tools->Options->Customization->Commands, choose Macros from List and drag the macro "Module1.ExportX" (or whatever you named it in "Sub" clause) to your toolbar, then Ok - now you have a button that calls your macro - it exports to gif in a folder of your opened file.

P.S. to tune settings easily - record new macro (Tools-VB-Record new), imeediately export your document to file with desired settings, then click Tools-VB-Stop, go to VBA Editor, find your recorded macro in "Recorded Macros" module, copy part from "With pal" to second "end with" inclusively to your gms macro ExportX
Reply With Quote
  #5  
Old 02-06-2006, 09:18
jfelder
Guest
 
Posts: n/a
Default Macros

Thank you.
The fact that my machine is locked down where I work will make it difficult to create a new GMS. I can't access my hard drive where programs are installed. I only have access to a network drive to save things.

Thanks for all the help. I appreciate your time and effort.
Reply With Quote
  #6  
Old 11-04-2008, 12:33
jfelder
Guest
 
Posts: n/a
Default

I am looking at this again.

I recorded a macro like you said above. I get this in the macro:

Sub ExportJPG()
'
' Recorded 4/11/2008
'
' Description:
'
'
End Sub


It doesn't record the dialogs I guess.

I tried using your code above but it does absolutely nothing when I click the button in my toolbar.
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
Pdf Export Files Just Rewrite Over And Over sifterbox CorelDRAW/Corel DESIGNER VBA 10 13-12-2011 08:58
Corel, Options, Customization, Commands, macros, "Separ Rick Randall CorelDRAW/Corel DESIGNER VBA 5 14-05-2009 12:20
Making Buttons for Macros xombie CorelDRAW/Corel DESIGNER VBA 4 15-07-2008 15:58
Problem the Macros with Corel X3 Paulo Neto Macros/Add-ons 0 10-05-2006 19:20
Problem with Export (or Save as) in AI-Format LOT CorelDRAW/Corel DESIGNER VBA 3 10-02-2004 15:28


All times are GMT -5. The time now is 18:19.


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