.CDR file thumbnails

Because Draw serves up the wrong thumbnail in Windows Explorer* I need a macro to set the page size to all objects in the document .

Google found me some in here and I tried them but each one puts the page offset from 0,0 bottom left, even this one from Sub GDG_John( )

Option Explicit

Sub fitCanvas()

    Dim s As Shape
    Dim w As Double, h As Double
   
    Set s = ActiveSelection
    If s.Shapes.Count = 0 Then
        MsgBox "Please make a selection"
        Exit Sub
    End If
    s.GetSize w, h
   
    ActivePage.SizeHeight = h
    ActivePage.SizeWidth = w
    ActiveDocument.ReferencePoint = cdrBottomLeft
   
    s.SetPosition 0, 0

End Sub

So anyone any ideas how I can make this work correctly so that the page correctly encompasses all objects? Ideally I don't want to SelectAll first either.

TIA

* I argued the toss about this on many occasions whilst I was a beta tester but got nowhere. CorelDraw stores two thumbnails minimum, one for Page1 and one called Thumbnail. For each extra page you get an additional thumbnail. In explorer the default is Page1 thumbnail which only shows what it on the page whereas Thumbnail displays all objects on the desktop. I couldn't give a fig about the page contents for drawings that are drawn at actual life size, but there is no way of making Draw serve up the Thumbnail.jpg. I argued that if the page border was not on display then the all objects thumbnail should be shown.

Parents
No Data
Reply
  • I need a macro to set the page size to all objects in the document

    We've had the debate about pages too many times Hywel, so I won't go there again. 

    There's one thing I would like to add though: The reason your objects don't show in the thumbnail is probably because they are on the Desktop layer, which by default is non-printable.
    Even though Eskimo's macro is excellent (use it all the time) you could most likely work around the problem by enabling "Print and Export" for the Desktop layer.

    Unfortunately, you cannot solve it by simply move all objects to a printable layer, because they will be moved back to the Desktop once you save or switch page, due to the "automatically-move-all objects-outside-the-drawing-area-to-Desktop" issue, an issue that was fixed (made optional) in Draw 2019.

Children