Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change CorelDraw X3 File Icon

Status
Not open for further replies.

Malik641

Programmer
Nov 29, 2006
11
US
Hi everyone,

I was wondering if there was a way to change the file icon for CorelDraw X3. Currently it is set to display the entire drawing as the file icon, but when I open folders or the FileOpen dialogue box it loads very slow (mostly because there's about 3000 drawings in the folder). So I wanted to know if I could just change it to the CorelDraw X3 graphic instead? Or if there was another icon I could choose that CorelDraw offers for .cdr files?

Thanks for any info/tips.
 
Hi Malik!

Surely the obvious way to overcome your problem is to split your existing folder into many sub-folders. Anyone knows that storing 3000 documents in one place is ludicrous.
You wouldn't do that in a well organised office.
Just how would you find what you are looking for?

The fault does not lie with Corel Draw X3, but with your methods of filing.
 
Hi BernBennett,

You know, I'm surprised I didn't think of that myself.

The drawings are really drafting drawings (not sure why we aren't using AutoCAD for this...) for safety harnesses. It's all alpha-numeric and not hard to sift through, but I do agree it would be much better organized based on harness type.

Anyway I still say that if I could defaul the file icon for Coreldraw that it would load folders much faster. I mean, the icon is so small I can't see what it is anyway (Folder View=Details), so why should Corel make windows load all unique file icons for each drawing rather than one generic cdr file icon? Or at least have the choice of either / or.

Thanks for the reply BernBennett,
Joseph
 
Hi Joseph,

I agree with you regarding the Corel Draw Icon.

If it was the green icon which appears when you check in Folder Options>File Types it would be much better.

But so far I have not found anyway of changing it.

Good luck with re-organising the drawings, Bern.
 
Hi Again Joseph,

Update time.

I've just found that the icon can be changed, but unfortunately only by doing a "Save As".

In the Save As Dialog Box, on the right hand side is a drop down list box for thumbnails, if you set this to "none" the file will be saved with the X3 green icon!!

Cannot find a script to do a batch file conversion, so I doubt it's worth doing on your 3000 drawings.

If I do find a script to do this, will post back, Bern
 
Bern,

That's excellent! I'm glad there's a way to do it!

If you can't find a script for it, I believe I can write some VBA code to do the whole conversion (if I do that, I'll post back with the code).

...just checked it out (Object browser), and I'll write the code. I'll be back to post.

Thanks Bern!

P.S. I just finished organizing all the files. It's much nicer (although I had to modify my excel VBA code to suit the new folders...but that was fun too :) )
 
Ok, I made some VBA code to do this. It takes a bit of time, though...but I'm not sure if there's a faster way to do this. With 88 files (as a test) totalling 9.3 MB in size, it took my computer about 1 minute to complete. At that rate, 3000 files will take a little over a half-an-hour. So I'll be doing one folder at a time (when most everybody is gone so no drawings will be open and the code won't be interferred).

I'm having a problem with read-only files, though. When the code opens the file, it will bring up the SaveAs dialogue box...which it doesn't for non-read-only files.

Here's the code:

Code:
Option Explicit
Option Compare Text
Option Private Module

Public Sub DrawingFileIconChange(ByVal strPath As String)
' This will save all corel files with a standard file icon
    Dim objCorel As CorelDRAW.Application
    Dim objDoc As CorelDRAW.Document
    Dim SaveOptions As CorelDRAW.StructSaveAsOptions
    
    Dim vFileArray() As String
    Dim i As Long
    Dim TempString As String
    
    ReDim vFileArray(0)
    ' Get all files from strPath
    Call ReturnAllFilesUsingDir(strPath, vFileArray())
    
    Set objCorel = New CorelDRAW.Application
    Set SaveOptions = New CorelDRAW.StructSaveAsOptions
            
    With SaveOptions
        .EmbedVBAProject = False
        .Filter = cdrCDR
        .IncludeCMXData = False
        .Range = cdrAllPages
        .EmbedICCProfile = False
        .ThumbnailSize = cdrNoThumbnail 'This is for the conversion
        .Version = cdrVersion10         'Saved as Version10 for my work's sake
    End With
            
    If Not IsError(vFileArray(0)) Then
        For i = LBound(vFileArray()) To UBound(vFileArray())
            If Right(vFileArray(i), 3) = "cdr" Then
                Set objDoc = objCorel.OpenDocument(vFileArray(i))
                
                ' SaveAs with no thumbnail (also Version10)
                objDoc.SaveAs vFileArray(i), SaveOptions
                objDoc.Close
            End If
        Next
        
        objCorel.Quit
    End If
End Sub

Function ReturnAllFilesUsingDir(ByVal vPath As String, ByRef vsArray() As String) As Boolean
' Function thanks to Mvidas from [URL unfurl="true"]www.VBAExpress.com[/URL]
    Dim tempStr As String, vDirs() As String, Cnt As Long, dirCnt As Long
    Dim PctDone As Long
    
    'Set caption for progress bar
    frmProgress.lblDescription = "Searching for Files..."
    frmProgress.Repaint
    
    If Len(vsArray(0)) = 0 Then
        Cnt = 0
    Else
        Cnt = UBound(vsArray) + 1
    End If
    If Right(vPath, 1) <> "\" Then vPath = vPath & "\"
    On Error GoTo BadDir
    tempStr = Dir(vPath, 31)
    
    Do Until Len(tempStr) = 0
        If Asc(tempStr) <> 46 Then
            If GetAttr(vPath & tempStr) And vbDirectory Then
                ReDim Preserve vDirs(dirCnt)
                vDirs(dirCnt) = tempStr
                dirCnt = dirCnt + 1
            End If
BadDirGo:
        End If
        tempStr = Dir
SkipDir:
    Loop
    On Error GoTo BadFile
    tempStr = Dir(vPath, 15)
    Do Until Len(tempStr) = 0
        ReDim Preserve vsArray(Cnt)
        vsArray(Cnt) = vPath & tempStr
        Cnt = Cnt + 1
        tempStr = Dir

    Loop
    Debug.Print Cnt
BadFileGo:
    On Error GoTo 0
    If dirCnt > 0 Then
        For dirCnt = 0 To UBound(vDirs)
            If Len(Dir(vPath & vDirs(dirCnt))) = 0 Then
                ReturnAllFilesUsingDir vPath & vDirs(dirCnt), vsArray
            End If
        Next
    End If
    Exit Function
BadDir:
    If tempStr = "pagefile.sys" Or tempStr = "???" Then
         '  Debug.Print "DIR: Skipping: " & vPath & tempStr
        Resume BadDirGo
    ElseIf Err.Number = 52 Then 'or err.number=5 then
         '  Debug.Print "No read rights: " & vPath & tempStr
        Resume SkipDir
    End If
    Debug.Print "Error with DIR (BadDir): " & Err.Number & " - " & Err.Description
    Debug.Print " vPath: " & vPath
    Debug.Print " tempStr: " & tempStr
    Exit Function
BadFile:
    If Err.Number = 52 Then 'or err.number=5 then
         '  Debug.Print "No read rights: " & vPath & tempStr
    Else
        Debug.Print "Error with DIR (BadFile): " & Err.Number & " - " & Err.Description
        Debug.Print " vPath: " & vPath
        Debug.Print " tempStr: " & tempStr
    End If
    Resume BadFileGo
End Function
 
Ok, I'll get around the Read-Only files this way (just won't be changing them..it's a small sacrifice).

Code:
                If (GetAttr(vFileArray(i)) And vbReadOnly) = 0 Then
                    Set objDoc = objCorel.OpenDocument(vFileArray(i))
                    
                    ' SaveAs with no thumbnail (also Version10)
                    objDoc.SaveAs vFileArray(i), SaveOptions
                    objDoc.Close
                End If

Thanks again Bern. If you find a script to do this or a faster way please let me know. For now, this will be a slow process. But a process I'm willing to sit though =)
 
Thanks Joseph,

Will save the code.
May come in useful at a later date, but at the present time I've only a score of files which need changing.

Very pleased we sorted it between us.
"Two heads are better than one" even if one of 'em, (mine) is almost 79 yrs old!!

Have a good Xmas, Bern.
 
What?! 79 years old? Are you serious?

And I'm glad we figured it out in one day!! ::thumbs up::
And if I don't here from ya, have a good Xmas too =)

Joseph
 
Did ya'll ever figure out how to change the CorelDraw X3 icon from a preview image to the green CorelDraw icon???
 
Yes! I did.

You will need to do a "Change" installation, using the CD1.
After the initial screen appears,select "Change" and when Custom Install appears,scroll down to "Utilities" and expand it
then insert a Red Cross in "Thumbnail Display" using the drop-down list box. Click next and away you go.
No more thumbnails, just the green icon.
 
Thanks BernBennett for the tip!

Also, I've actually noticed that the preview image loads faster than the CDR thumbnail (this is saving as cdr version 10)...interesting, huh?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top