我用了宏的。但是不知道怎么和VB衔接。
这个是主程序
Private Sub mnuPara_Click()‘点击菜单栏的命令
Dim InitDir As String
Dim fn As Integer
Dim i As Integer
fn = FreeFile
With CommonDialog1
.InitDir = App.Path
.Filter = "word文档(*.doc)|*.doc|所有文件(*.*)|*.*"
.CancelError = True
.Flags = cdlOFNOverwritePrompt Or cdlOFNPathMustExist
On Error GoTo errtrap
.ShowSave
Open .FileName For Output As fn
'Dim i As Long
Call insertpic
end sub
下面的是宏
Sub insertpic()
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
CommandBars("AutoShapes").Visible = False
Selection.InlineShapes.AddPicture FileName:=.FileName , LinkToFile:=False, SaveWithDocument:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
程序报错。