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 05-07-2012, 09:36
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Post File save with date

Hallo members.

How do I add the date to file name?

I'm using CorelDraw v12.

Code:
Sub ExportSelectionToDesktop()

    Dim OrigSelection As ShapeRange, expflt As ExportFilter

    Set OrigSelection = ActiveSelectionRange

        Set expflt = ActiveDocument.ExportBitmap( _
            "c:\Users\xxx\Desktop\" & ActiveDocument.Name & "HOW TO INSERT THE CURRENT DATE" & ".jpg", _
            cdrJPEG, cdrSelection, cdrRGBColorImage, , , 300, 300, cdrSupersampling, , , UseColorProfile:=True)

    With expflt
        .Progressive = True
        .Optimized = True
        .SubFormat = 0
        .Compression = 0
        .Smoothing = 0
        .Finish
    End With

End Sub
Thanks in advance.

Regards.

~GrzJanik

Last edited by grzjanik; 06-07-2012 at 03:03.
Reply With Quote
  #2  
Old 10-07-2012, 17:12
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Version 12 should have it. It's a VBA function.

Code:
Private Sub ExportSelectionToDesktop()


    MsgBox VBA.CStr(VBA.Replace(VBA.Date, "/", "-"))
    
    Dim OrigSelection As ShapeRange, expflt As ExportFilter

    Set OrigSelection = ActiveSelectionRange

        Set expflt = ActiveDocument.ExportBitmap( _
            "c:\Users\xxx\Desktop\" & ActiveDocument.Name & VBA.CStr(VBA.Replace(VBA.Date, "/", "-")) & ".jpg", _
            cdrJPEG, cdrSelection, cdrRGBColorImage, , , 300, 300, cdrSupersampling, , , UseColorProfile:=True)

    With expflt
        .Progressive = True
        .Optimized = True
        .SubFormat = 0
        .Compression = 0
        .Smoothing = 0
        .Finish
    End With

End Sub
~John

Last edited by runflacruiser; 10-07-2012 at 17:14.
Reply With Quote
  #3  
Old 11-07-2012, 15:28
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Smile Date

Thanks John.

It works very well in Corel v.12.

How to write for the date format was day_month_year?
(TestFile_11_07_2012.jpg)

Thanks & regards.
~GrzJanik
Reply With Quote
  #4  
Old 11-07-2012, 19:35
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
Cool. Give this one a shot:

Code:
Private Sub ExportSelectionToDesktop()

    Dim strD$
    strD = CStr(Format(VBA.Date, "dd-mm-yyyy"))
    MsgBox strD 'for testing
    Dim OrigSelection As ShapeRange, expflt As ExportFilter

    Set OrigSelection = ActiveSelectionRange

        Set expflt = ActiveDocument.ExportBitmap( _
            "c:\Users\xxx\Desktop\" & ActiveDocument.Name & strD & ".jpg", _
            cdrJPEG, cdrSelection, cdrRGBColorImage, , , 300, 300, cdrSupersampling, , , UseColorProfile:=True)

    With expflt
        .Progressive = True
        .Optimized = True
        .SubFormat = 0
        .Compression = 0
        .Smoothing = 0
        .Finish
    End With

End Sub
~John
Reply With Quote
  #5  
Old 13-07-2012, 10:59
grzjanik grzjanik is offline
Member
 
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Default Date

Thanks John.

Perfect work.
This is exactly what I need.

Thank you. Regards.

~GrzJanik
Reply With Quote
Reply

Tags
date, save


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
save all grouped objects as a cdr file runflacruiser CorelDRAW/Corel DESIGNER VBA 4 26-06-2009 22:55
Save pdf as CorelDraw File Name ProofingGuy CorelDRAW/Corel DESIGNER VBA 8 12-06-2008 10:15
How to import values from a file, replace text,save file for each value with new name amaart CorelDRAW/Corel DESIGNER VBA 1 28-09-2007 13:41
how to save multiple pages in coreldraw 12 OR how to save quality eps for animation kickingandscreaming General 2 19-08-2007 23:28
VBA & Photoshop. How Save File anover format? igor___ CorelDRAW/Corel DESIGNER VBA 5 30-11-2006 11:28


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


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