![]() |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
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 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 -Shelby |
#3
|
|||
|
|||
![]()
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 |
![]() |
Tags |
corel, macros |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
UNLIMITED recent files dialog for CorelDraw with love | wOxxOm | CorelDRAW/Corel DESIGNER VBA | 196 | 18-01-2013 14:51 |
Pdf Export Files Just Rewrite Over And Over | sifterbox | CorelDRAW/Corel DESIGNER VBA | 10 | 13-12-2011 08:58 |
CorelDraw 10 DXF export relative coordinates - VBA solution? | asb617 | CorelDRAW/Corel DESIGNER VBA | 2 | 01-04-2010 03:34 |
In Need of VBA Macro to Export Files | jfelder | Macros/Add-ons | 2 | 08-08-2008 09:18 |
Coreldraw and importing Excell files | GoodLook | General | 0 | 24-08-2004 05:49 |