您的位置:首页 > 编程语言 > VB

VB6为报表盖电子图章

2016-03-08 18:54 363 查看
    


    图中右下角是电子图章,VB代码如下:

    Dim shp As Object

    Dim DZTZ As String

    

    DZTZ = ThisWorkbook.Path & "\" & "YWTJTZ.JPG"

    If Dir(DZTZ) = "" Then

        MsgBox "目录下没有电子图章。", vbInformation, "提示"

    End If

    

    Set shp = ActiveSheet.Pictures.Insert(DZTZ)

    With shp

        .Left = ActiveCell.Left + Int((ActiveCell.Width - 40) / 2)

        .Top = ActiveCell.Top + Int((ActiveCell.Height - 40) / 2)

        .Height = 40

        .Width = 40

    End With

    Set shp = Nothing
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: