CorelDRAW——VBA实例篇一个简单的VBA插件
生活随笔
收集整理的這篇文章主要介紹了
CorelDRAW——VBA实例篇一个简单的VBA插件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
函數代碼:?(ALT+F11快速進入宏編輯)
Public Sub Demo1() Rem|"視圖-此處為第一種注釋方法" ' Load UserForm1 加載窗口UserForm1-此處為第二種注釋方法Load UserForm1If ActiveWindow.ActiveView.Type = cdrEnhancedView ThenUserForm1.Text = "Enhanced"ElseIf ActiveWindow.ActiveView.Type = cdrNormalView ThenUserForm1.Text = "Normal"ElseIf ActiveWindow.ActiveView.Type = cdrWireframeView ThenUserForm1.Text = "Wireframe"ElseIf ActiveWindow.ActiveView.Type = cdrSimpleWireframeView ThenUserForm1.Text = "Simple Wireframe"ElseIf ActiveWindow.ActiveView.Type = cdrEnhancedViewWithOverprints ThenUserForm1.Text = "Enhanced WithOverprints"ElseUserForm1.Text = "Draft" '此處結束If語句判斷End If '顯示(名稱)為UserForm1的窗口UserForm1.Show '函數結束語 End Sub窗口效果圖:?
查看窗口代碼:?
Private Sub Bt1_Click() '賦值視圖類型 ActiveWindow.ActiveView.Type = cdrSimpleWireframeView MsgBox "簡單線框" '給文本框賦值 Text.Text = "Simple Wireframe" '刷新顯示 UserForm1.Repaint End SubPrivate Sub Bt2_Click() ActiveWindow.ActiveView.Type = cdrWireframeView MsgBox "線框" Text.Text = "Wireframe" '刷新顯示 UserForm1.Repaint End SubPrivate Sub Bt3_Click() ActiveWindow.ActiveView.Type = cdrDraftView MsgBox "草稿" Text.Text = "Draft" '刷新顯示 UserForm1.Repaint End SubPrivate Sub Bt4_Click() ActiveWindow.ActiveView.Type = cdrNormalView MsgBox "正常" Text.Text = "Normal" '刷新顯示 UserForm1.Repaint End SubPrivate Sub Bt5_Click() ActiveWindow.ActiveView.Type = cdrEnhancedView MsgBox "增強" Text.Text = "Enhanced" '刷新顯示 UserForm1.Repaint End SubPrivate Sub Bt6_Click() ActiveWindow.ActiveView.Type = cdrEnhancedViewWithOverprints MsgBox "使用疊印增強" Text.Text = "Enhanced WithOverprints" '刷新顯示 UserForm1.Repaint End Sub?到繪圖界面運行宏名稱為Demo1的宏
效果圖:
…………………………………………………………4:46繼續更新
總結
以上是生活随笔為你收集整理的CorelDRAW——VBA实例篇一个简单的VBA插件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python学习记录2
- 下一篇: Mac安装telnet工具和使用