码迷,mamicode.com
首页 > 编程语言 > 详细

CDR VBA鼠标选择

时间:2016-11-26 23:29:01      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:false   div   shape   atp   als   user   cti   rcu   get   

    Dim x As Double, y As Double, Shift As Long, b As Boolean, doc As Document
    Dim sel1 As Shape, sel2 As Shape, s1 As Shape, s2 As Shape
    
    Set doc = ActiveDocument
    
    b = False
    While Not b
        b = doc.GetUserClick(x, y, Shift, 10, False, cdrCursorWinCross)
        Set sel1 = doc.ActivePage.SelectShapesAtPoint(x, y, False)
        If sel1.Shapes.Count > 0 Then
            Set s1 = sel1.Shapes.Last
            doc.ClearSelection
            s1.AddToSelection
        End If
        
        b = doc.GetUserClick(x, y, Shift, 10, False, cdrCursorWinCross)
        Set sel2 = doc.ActivePage.SelectShapesAtPoint(x, y, False)
        If sel2.Shapes.Count > 0 Then
            Set s2 = sel2.Shapes.Last
            doc.ClearSelection
            s2.AddToSelection
        End If
        
        s1.AlignToShape cdrAlignBottom, s2
        s1.AlignToShape cdrAlignRight, s2
    Wend

  

CDR VBA鼠标选择

标签:false   div   shape   atp   als   user   cti   rcu   get   

原文地址:http://www.cnblogs.com/cdrapp/p/6105405.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!