我只是做了个示例,楼主可自行加入修改 Private Sub CommandButton2_Click() Dim grt1 As String, myRange As Range Dim bk As String, myShape As Shape Dim sinLeft As Single, sinTop As Single If OptionButton1.Value = True Then bk = "图形01" End If If OptionButton2.Value = True Then bk = "图形02" End If If OptionButton3.Value = True Then bk = "图形03" End If grt1 = ActiveDocument.AttachedTemplate.Path sinLeft = Selection.Information(wdHorizontalPositionRelativeToPage) sinTop = Selection.Information(wdVerticalPositionRelativeToPage) Selection.InsertFile FileName:=grt1 & "\图库.doc", Range:=bk, ConfirmConversions:=False, Link:=False, Attachment:=False Unload Me Set myShape = ActiveDocument.Shapes(ActiveDocument.Shapes.Count) With myShape .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage .Left = sinLeft .RelativeVerticalPosition = wdRelativeVerticalPositionPage .Top = sinTop .WrapFormat.Type = wdWrapInline'根据你自己的情况进行处理,是否需要此设置 End With End Sub |