Hi All.
Does anyone know of a simple clipboard manager that supports .cdr objects. I've just been playing around with Ditto, but can't get it to support CorelDraw.Just want to be able to store multiple object/s on the clipboard without them being converted to a bitmap. Possible with text and bitmaps but is it possible with CorelDraw objects.
Anyone
Cheers
Sark
sark said: Does anyone know of a simple clipboard manager that supports .cdr objects. I've just been playing around with Ditto, but can't get it to support CorelDraw.Just want to be able to store multiple object/s on the clipboard without them being converted to a bitmap. Possible with text and bitmaps but is it possible with CorelDraw objects.
I know about clipboard managers that handle text and some types of images, and some other clipboard formats, but I am unaware of one that can save multiple clips of the full "custom data" that CorelDRAW can copy/paste. If you ever find out about such a clipboard manager, then please let us know!
You mention in another post that there are other ways of saving objects in Draw. I wrote a little bit of VBA code to make it easier to use one of those ways: storing the objects in CorelDRAW documents.
When run, this macro carries out a "Save As Copy" of the active document, including only the active selection. The filename is based on the name of the active document, and also adds a time stamp - e.g., "From MyDocument 2018-05-24 230256.cdr". In the current version of the macro, the folder path is specified as a constant.
The files that are created can then be imported into CorelDRAW documents using drag-and-drop from that folder. It's not exactly like copying/pasting, to the extent that the imported content comes in as a group.
VIDEO: Save Selection To Temporary
For recording that video, I used DeskPins to keep that folder in front of the CorelDRAW window. For CorelDRAW versions that have it, another alternative is to use the Connect docker to access the contents of that folder.
Eskimo.
That's very useful. CD12 has the Scrapbook Manager that is very similar. By dragging and dropping into the Scrapbook docker window you can save selections to a predetermined folder. You can then just drag selections from the Scrapbook window to the page when required.The only issue is that it uses a default icon and no visual preview. Each selection saved is named scrap1, scrap2 etc, so not even a name that relates to the object saved. It has its uses, and does save permanently, but not quite a clipboard manager.
Here is a simplified version with the folder path directly written in the macro:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
Option Explicit Const strMacroName As String = "Save Selection as Copy" Const strSSACFolderPath As String = "D:\SSAC" Sub Save_Selection_As_Copy_Simple() Dim strDocFilename As String Dim strFullPath As String Dim OptSave As New StructSaveAsOptions On Error GoTo ErrHandler If Not ActiveDocument Is Nothing Then If ActiveSelectionRange.Count > 0 Then strDocFilename = "From " & ActiveDocument.Name strDocFilename = Replace(strDocFilename, ".cdr", "") strDocFilename = Replace(strDocFilename, ".cdt", "") strDocFilename = strDocFilename & " " & (Format(Now, "YYYY_MM_DD_hhmmss")) & ".cdr" If Len(strSSACFolderPath) > 208 Then MsgBox "The file path would be " & Len(strSSACFolderPath) + 1 & " characters." & vbCrLf & vbCrLf & "The file path cannot be longer than 209 characters.", vbInformation, strMacroName GoTo ExitSub End If strFullPath = strSSACFolderPath & "\" & strDocFilename If Len(strFullPath) > 259 Then MsgBox "The path and file name would be " & Len(strFullPath) & " characters." & vbCrLf & vbCrLf & "The path and file name cannot be longer than 259 characters." & vbCrLf & vbCrLf & "No document was saved.", vbExclamation, strMacroName GoTo ExitSub End If OptSave.Range = cdrSelection ActiveDocument.SaveAsCopy strFullPath, OptSave Else MsgBox "Nothing is selected.", vbInformation, strMacroName End If Else MsgBox "No document is active.", vbInformation, strMacroName End If ExitSub: Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub Sub Open_SSAC_Folder() On Error GoTo ErrHandler Shell "C:\Windows\explorer.exe """ & strSSACFolderPath & "", vbNormalFocus ExitSub: Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
That gives you something with which you can experiment.
If that works for you, and you decide that you would like to try building a version with a userform, then let me know. I could give you a copy of the code for the userform as plain text.
My usual approach to something like this is to get the simple version to work first.
Eskimo... Thanks for that. I'm not at home right now so can't fully digest it. I haven't coded anything quite like this yet. Can create the User Form though, but will be interesting to see how this all translates to CD12.
One question I forgot to ask. In the video, are you displaying a preview in the temp folder because Display Thumbnails Is enabled/installed? If I install the thumbnail display for CD12 and create a macro to save to the Scrapbook folder, I get a thumbnail/preview, but I'm not a fan of having all saved CD files stored on my drive with thumbnail displays. If I can use your code and add a relative description when saving to the Scrapbook that would be very useful.
Much appreciated.
sark said:In the video, are you displaying a preview in the temp folder because Display Thumbnails Is enabled/installed?
That is correct. I'm seeing the thumbnails because of Corel's shell extension - if I have the Explorer window set to show Medium, Large, or Extra-Large icons.
sark said:If I can use your code and add a relative description when saving to the Scrapbook that would be very useful.
When you write, "add a relative description", where are you thinking of adding such a description?
I'm not familiar with Scrapbook.
Well, firstly, I've now managed to get the Scrapbook docker to display a Save As (Selection) with a preview. I can now do this without installing the Thumbnail Display, so I can also save cdr documents without thumbnails, which is what I was trying to achieve.
The next step is to code so that the Save As macro does not save as and overwrite Graphic1 each time, or require the need to name each saved selection. A simple numbering system will probably suffice now I have a preview, but " adding a relative description" like the Object Managers description (a Shape Type). would be as close to a perfect clipboard manager as think I'm likely to achieve.
This is basically what your video shows but utilising the Scrapbook docker. I'll post a video if/when I get it to work as hoped.
I am working today on a computer that has X3 installed.
Checking in the Object Browser, I found that .SaveAsCopy is not shown as a method of Document.
So, sorry, but my code as written will not work in X3.
I found one reference on-line that claimed that X5 was the first version to have SaveAsCopy.
That's the bad news - but there also seems to be good news!
It seems that older versions (e.g., X3) behave differently than newer versions (e.g., X7) when Document.SaveAs is used.
If I use the code I posted above with one change:
ActiveDocument.SaveAs strFullPath, OptSave
then the macro works correctly for me in X3.
If the folder specified in the macro exists (in my code, it's D:\SSAC), then the macro does NOT open a dialog for saving the file; it just creates the new file (with only the selected objects present).