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.
sark said: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.
The macro the way I posted it above includes the date/time in the filename, as well as the name of the file that it was originally saved from. It was my intention that content saved using this macro would be browsed visually, e.g., by looking at the thumbnails.
Automatically generating a "meaningful name" might be possible if you were only using this for saving single shapes.
Eskimo said: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.
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.
Yes... I removed some of your error handling to pinpoint that issue. I will give the amended line a try tonight. I haven't had any issues with the document closing so clearly a later version approach.
Eskimo said:Automatically generating a "meaningful name" might be possible if you were only using this for saving single shapes
Yes,. I would have to group multiple objects to overcome this. I now think a number and time tag for each selection saved is the way to go.
Eskimo said: It was my intention that content saved using this macro would be browsed visually, e.g., by looking at the thumbnails.
I prefer to save documents without previews, but it would be useful to save selections from a doc (with a preview) for future use if desired. This is now possible with the ScrapBook because it is basically a browser that lets you navigate to any folder with which I can now see a preview of .cdr files/selections. Once I have all my selections I want to save I can just dump them into a separate folder than the SSAC folder and use the ScrapBook docker to navigate to at a future date and access complete with a preview.
It seems strange that the ScrapBook was around so long and Corel never added a preview option for its drag and drop functionality ???
Again, just like to say your time is truly appreciated. It's also been interesting in terms of coding knowledge gained. I'll post that video when all is as hoped.
Just got back off holiday. Have now been able to reassess the Scrapbook “Clipboard Manager” after some time away. Decided to go with the sequential number approach (Clip-1, Clip-2, Clip-3 etc). I opted for this partly because I couldn’t figure out how to change the time stamp to the commonly used (hh:mm:ss). I spent a lot of time on this. For some reason placing (:) between the hours, minutes and seconds killed functionality. I was just overwriting the previous selection. I can use other characters as separators but not the commonly used (:). Perhaps just a CD12 issue? Any thoughts on this?
I also added a UserForm splash screen to confirm copying, and hence negating the need for the Scrapbook docker to be open, but found it annoying so dropped it. I did add the automatic creation of a Scrapbook folder if not already created, which is useful.
If you’re still happy to post the UserForm code I would be grateful. The Scrapbook docker enables most of what’s required regarding managing folders, however, whilst I can create and save to a Scrapbook folder and later rename it to, say Scrapbook1, to save for future use. If later I want to add to that folder, I first have to change the default name of the current Scrapbook folder before renaming Scrapbook1 back to just Scrapbook (the hard code default). A simple method of changing the hard coded path would simplify this. With the added bonus of saving to any location.
Many thanks
sark said:I opted for this partly because I couldn’t figure out how to change the time stamp to the commonly used (hh:mm:ss)
There are "reserved characters" that are not allowed in Windows file names.
Eskimo said:There are "reserved characters" that are not allowed in Windows file names.
I'm with you. Never considered that.
sark said:If you’re still happy to post the UserForm code I would be grateful.
OK, here's a .ZIP archive that includes two plain text files. One is the code from my main module; the other is the code from the UserForm. It also include a .PDF file showing the naming of the controls on the UserForm.
JQ Save Selection as Copy (code).zip
In order to use the FileSystemObject stuff, Microsoft Scripting Runtime has to be referenced. I get using Tools>References in the VBA editor:
As discussed earlier in the thread, where I have used "SaveAsCopy", I think you will need to use "SaveAs". That's what I observed in X3.