![]() |
#1
|
|||
|
|||
![]()
Is it a way in case of ExportBitmap automation to receive a warning in case of a file with the same name already exists?
I mean for the next piece of code is it a way to stop export in case that a file with the same name already exists in the export folder... Code:
Set Filter = d.ExportBitmap(strFile, cdrJPEG, cdrCurrentPage, _ cdrRGBColorImage, 1000, 1000, 300, 300) With Filter .Compression = 80 .Optimized = True .Smoothing = 10 .SubFormat = 1 .Progressive = False .Finish 'is there a way to stop this part for the same file name in export location folder... End With |
#2
|
|||
|
|||
![]()
you can use the standard function FileAttr to see whether a file exists:
Code:
If CorelScriptTools.FileAttr(strFile) <> 0 Then If MsgBox("Rewrite " + strFile + " ?", vbYesNo + vbQuestion, _ "File exist") = vbNo Then ' set new name for strFile else ' rewrite file end if end if 'your code... Set Filter = d.ExportBitmap(strFile, cdrJPEG, cdrCurrentPage, _ cdrRGBColorImage, 1000, 1000, 300, 300) |
#3
|
|||
|
|||
![]()
Thanks!
I found a similar workaround: Code:
Inceput: 'Code using GetFileBox to select the name but seeing the pictures there, returning strFile... Director = Left(strFile, InStrRev(strFile, "\")) NumeDublu = Right(strFile, Len(strFile) - InStrRev(strFile, "\")) Fisier = Dir$(Director) Do While Len(Fisier) <> 0 Fisier = Dir$: If Fisier = NumeDublu Then GoTo Nasol Loop Filter.Finish 'Some other code here... GoTo Sfarsit Nasol: Dim Rasp As VbMsgBoxResult Rasp = MsgBox("The file named """ & NumeDublu & """ already exists in the export location." & vbCrLf & _ " Would you like to rewrite it?" & vbCrLf & vbCrLf & _ " If yes, please choose ""Yes""..." & vbCrLf & _ " For renaming choose ""Cancel"".", vbYesNoCancel, "Existing name") If Rasp = vbYes Then Filter.Finish 'some code here... GoTo Sfarsit End If If Rasp = vbCancel Then GoTo Inceput Sfarsit: |
![]() |
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 |
Pdf Export Files Just Rewrite Over And Over | sifterbox | CorelDRAW/Corel DESIGNER VBA | 10 | 13-12-2011 07:58 |
How to Bring up Convert to Bitmap dialog when using ExportBitmap | abdoj | CorelDRAW/Corel DESIGNER VBA | 0 | 17-05-2010 11:51 |
C++Builder6 ExportBitmap | pasha01 | CorelDRAW/Corel DESIGNER VBA | 0 | 06-12-2009 13:08 |
CorelDRAW 12 ExportBitmap | MrClark | CorelDRAW/Corel DESIGNER VBA | 3 | 14-09-2005 15:15 |
alex!why don't you rewrite you secridesign? | lees | CorelDRAW/Corel DESIGNER VBA | 0 | 18-06-2004 09:46 |