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 18-03-2009, 15:02
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 151
Default Export files from coreldraw and name it

1. if i export some object from a document to a defined folder(say d:\jpgs\Myfile.jpg)
And the file exists now the task is to export it as D:\jpgs\Myfile(1).jpg
Code to see first that if the file exist and if exists name it sequencially
Reply With Quote
  #2  
Old 18-03-2009, 16:26
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Testing if file exists...

There are several way to do this, here are two simple versions:
Code:
Sub UsingDir()
    If Dir("C:\Temp\fillets.bmp") <> "" Then
        MsgBox "Exists"
    Else
        MsgBox "Does not exist"
    End If
End Sub
And the other:
Code:
Sub UsingAttr()
    Dim attr As VbFileAttribute
    
    On Error Resume Next
    attr = GetAttr("C:\Temp\fillet.bmp")
    If Err.Number = 0 And (attr And (vbArchive + vbHidden + vbNormal + vbReadOnly)) <> 0 Then
        MsgBox "Exists"
    Else
        MsgBox "Does not exist"
    End If
End Sub
Best of luck,

-Shelby
Reply With Quote
  #3  
Old 19-03-2009, 05:56
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 151
Default

thanks Shalby,
it works fine, i was not using corelscripttools they are wonderful.
For renaming like if the file exist(Myfile.jpg, Myfile(1).jpg) do Vista has some buitin function to rename the file by itself as while copying a file in explorer it give two options 1. copy & replace 2. copy & keep both
hoe to access that function
Reply With Quote
  #4  
Old 19-03-2009, 11:03
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Rename...

I don't know of a way to use Vista's built in feature. You would need to write your own solution that simple prompted and then rename with the appropriate number.

-Shelby
Reply With Quote
Reply

Tags
corel, macros


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
UNLIMITED recent files dialog for CorelDraw with love wOxxOm CorelDRAW/Corel DESIGNER VBA 196 18-01-2013 13:51
Pdf Export Files Just Rewrite Over And Over sifterbox CorelDRAW/Corel DESIGNER VBA 10 13-12-2011 07:58
CorelDraw 10 DXF export relative coordinates - VBA solution? asb617 CorelDRAW/Corel DESIGNER VBA 2 01-04-2010 02:34
In Need of VBA Macro to Export Files jfelder Macros/Add-ons 2 08-08-2008 08:18
Coreldraw and importing Excell files GoodLook General 0 24-08-2004 04:49


All times are GMT -5. The time now is 00:39.


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