(轉載於Zebe )CorelDRAW-VBA
阿新 • • 發佈:2018-12-16
--------------------- 作者:Zebe 來源:CSDN 轉載原文連結:https://blog.csdn.net/zebe1989/article/details/79029015
目的 本文介紹CorelDRAW建立文件後對文件進行屬性設定。
在建立文件後,你可以使用文件類的相應屬性指定文件的引用點、度量單位和繪圖比例。 Document.ReferencePoint屬性指定一個文件的參考點。在定位文件中的物件時引用此點。 Document.Unit屬性指定文件的度量單位。這個單位用於定位和放大該文件中的物件。 Document.WorldScale屬性指定一個文件的繪圖比例,如果不指定,則預設值是1。繪圖比例尺可以使繪圖中的距離與現實世界的距離成比例;例如,您可以指定繪圖中的1英寸對應於物理世界中的1米。
具體屬性值參考以下程式碼:
' 建立文件 Dim doc As Document Set doc = CreateDocument ' 設定文件參考點 doc.ReferencePoint = cdrBottomLeft ' 底部靠左對齊 doc.ReferencePoint = cdrBottomMiddle ' 底部居中對齊 doc.ReferencePoint = cdrBottomRight ' 底部靠右對齊 doc.ReferencePoint = cdrCenter ' 中心對齊 doc.ReferencePoint = cdrMiddleLeft ' 中心靠左對齊 doc.ReferencePoint = cdrMiddleRight ' 中心靠右對齊 doc.ReferencePoint = cdrTopLeft ' 頂部靠左對齊 doc.ReferencePoint = cdrTopMiddle ' 頂部居中對齊 doc.ReferencePoint = cdrTopRight ' 頂部靠右對齊 ' 設定文件單位 doc.Unit = cdrAgate doc.Unit = cdrCentimeter ' 釐米 doc.Unit = cdrCicero doc.Unit = cdrDidots doc.Unit = cdrFoot ' 英尺 doc.Unit = cdrInch ' 英寸 doc.Unit = cdrKilometer ' 千米(公里) doc.Unit = cdrMeter ' 米 doc.Unit = cdrMile ' 英里 doc.Unit = cdrMillimeter ' 毫米 doc.Unit = cdrPica ' 派卡 doc.Unit = cdrPixel ' 畫素 doc.Unit = cdrPoint ' 點 doc.Unit = cdrTenthMicron doc.Unit = cdrUnitH ' 單位高度 doc.Unit = cdrUnitQ doc.Unit = cdrYard ' 碼