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 10-12-2009, 10:08
macrofan
Guest
 
Posts: n/a
Default Save as Old Version

Hi folks,
I've recorded a very simple of macro of saving active document as a version 9 in a specified location but the trouble is I don't how to make it save with the actual name of the active document rather than the one I used when I recorded the macro?

Here it is:
Sub save1()
Dim SaveOptions As StructSaveAsOptions
Set SaveOptions = New StructSaveAsOptions
With SaveOptions
.EmbedVBAProject = False
.Filter = cdrCDR
.IncludeCMXData = False
.Range = cdrAllPages
.EmbedICCProfile = False
.ThumbnailSize = cdr10KColorThumbnail
.Version = cdrVersion9
End With
ActiveDocument.SaveAs "K:\TEMPORARY FILES\CDR\test.cdr", SaveOptions
End Sub
Reply With Quote
  #2  
Old 10-12-2009, 11:09
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi,
Those are properties of the document class.

Code:
ActiveDocument.FileName 

'or 

ActiveDocument.FullFileName
In the corel object model help file choose index. Scroll to document. You will see properties and methods.
Check out the properties, and they usually have examples too.

Have fun!
-John
Reply With Quote
  #3  
Old 11-12-2009, 06:17
macrofan
Guest
 
Posts: n/a
Default

Hi John,
VBA language is pretty much like a Chinese language to me I took a look at the guide you referred me to but every thing went over my head.
Code:
Sub savev9()
    Dim SaveOptions As StructSaveAsOptions
    Set SaveOptions = New StructSaveAsOptions
    With SaveOptions
        .EmbedVBAProject = False
        .Filter = cdrCDR
        .IncludeCMXData = False
        .Range = cdrAllPages
        .EmbedICCProfile = False
        .ThumbnailSize = cdr10KColorThumbnail
        .Version = cdrVersion9
    End With
    ActiveDocument.SaveAs "E:\Temp Files\Graphic1.cdr", SaveOptions
End Sub
So where do I insert the line that you've suggested me above and what's the difference between active document file name and active document full file name? Thanks once again you've already proved to be very helpful to me.
Reply With Quote
  #4  
Old 11-12-2009, 09:06
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

I think this should work:

Code:
Sub save1()
Dim SaveOptions As StructSaveAsOptions
Dim fn As String
fn = ActiveDocument.FileName
Set SaveOptions = New StructSaveAsOptions
With SaveOptions
.EmbedVBAProject = False
.Filter = cdrCDR
.IncludeCMXData = False
.Range = cdrAllPages
.EmbedICCProfile = False
.ThumbnailSize = cdr10KColorThumbnail
.Version = cdrVersion9
End With
ActiveDocument.SaveAs "K:\TEMPORARY FILES\CDR\" & fn & " , SaveOptions"

End Sub
-John
Reply With Quote
  #5  
Old 11-12-2009, 09:57
macrofan
Guest
 
Posts: n/a
Default

Hi John,
It's saving with the right file name partially as it's adding extra string in the file name of save options for example if my file name is John.cdr then it's making it look like the one below:
Code:
john.cdr, SaveOptions
And secondly but more importantly it's not saving as version9 instead with my current version vX3. Any further ideas?
Reply With Quote
  #6  
Old 11-12-2009, 11:35
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
oops. My fault.
That's what I get for not testing.

Here's the fixed line for you:

Code:
ActiveDocument.SaveAs "K:\TEMPORARY FILES\CDR\" & fn, SaveOptions
-John

ps. I still didn't test but this should do it...lol
Reply With Quote
  #7  
Old 11-12-2009, 11:53
macrofan
Guest
 
Posts: n/a
Default Done

Heh thanks John that did it. You are damn so helpful arn't you.
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
JPEG to PLT in version 12 dixlin Site News 2 28-10-2009 18:59
how to save multiple pages in coreldraw 12 OR how to save quality eps for animation kickingandscreaming General 2 19-08-2007 22:28
New version soon? kortshop Calendar Wizard 1 19-10-2006 13:41
version no. in fileconverter.gsm ajk CorelDRAW/Corel DESIGNER VBA 5 21-03-2006 10:33
CorelDraw 10 Version Anonymous Jigsaw Puzzle Creator 0 07-11-2003 19:10


All times are GMT -5. The time now is 07:57.


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