forked from saniainf/CorelDraw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
Attribute VB_Name = "allFilesPlaceToPW" | ||
Sub SaveAndClose() | ||
Dim doc As Document | ||
Dim aPage As Page | ||
For Each doc In Application.Documents | ||
doc.Save | ||
doc.Close | ||
Next doc | ||
End Sub | ||
|
||
Sub PlaceToPW() | ||
Application.Optimization = True | ||
|
||
Dim doc As Document | ||
Dim aPage As Page | ||
For Each doc In Application.Documents | ||
doc.Activate | ||
doc.Unit = cdrMillimeter | ||
For Each aPage In doc.Pages | ||
aPage.Activate | ||
PlaceAllToPowerClip aPage | ||
Next aPage | ||
Next doc | ||
|
||
Application.Optimization = False | ||
ActiveWindow.Refresh | ||
Application.Refresh | ||
End Sub | ||
|
||
Sub ChangePageSize() | ||
Dim height As Integer | ||
Dim width As Integer | ||
|
||
Set height = 127 | ||
Set width = 47 | ||
|
||
Application.Optimization = True | ||
|
||
Dim doc As Document | ||
Dim aPage As Page | ||
For Each doc In Application.Documents | ||
doc.Activate | ||
doc.Unit = cdrMillimeter | ||
For Each aPage In doc.Pages | ||
aPage.Activate | ||
aPage.SizeHeight = height | ||
aPage.SizeWidth = width | ||
Next aPage | ||
Next doc | ||
|
||
Application.Optimization = False | ||
ActiveWindow.Refresh | ||
Application.Refresh | ||
End Sub | ||
|
||
|
||
Sub PlaceAllToPowerClip(aPage As Page) | ||
Dim aSel As ShapeRange | ||
Dim shPowerClip As Shape | ||
Dim sL As Integer | ||
Dim sT As Integer | ||
Dim sR As Integer | ||
Dim sB As Integer | ||
Dim aLayer As Layer | ||
Dim guideL As Boolean | ||
guideL = False | ||
If aPage.GuidesLayer.Editable Then | ||
guideL = True | ||
aPage.GuidesLayer.Editable = False | ||
aPage.GuidesLayer.Printable = False | ||
End If | ||
sL = aPage.BoundingBox.Left | ||
sT = aPage.BoundingBox.Top | ||
sR = aPage.BoundingBox.Right | ||
sB = aPage.BoundingBox.Bottom | ||
For Each aLayer In aPage.Layers | ||
If aLayer.Editable Then | ||
If aLayer.Shapes.All.Count > 0 Then | ||
Set aSel = aLayer.Shapes.All | ||
Set shPowerClip = aLayer.CreateRectangle(sL, sT, sR, sB) | ||
shPowerClip.Outline.SetNoOutline | ||
aSel.AddToPowerClip shPowerClip, cdrFalse | ||
End If | ||
End If | ||
Next aLayer | ||
aPage.GuidesLayer.Editable = guideL | ||
End Sub |