主题:诚意求教vb问题
我想在word中设计一个宏,将word文件书签bm1的内容复制到execl文件book1中表sheet1的范围a1中,代码如下,但是运行错误,请指教!
Selection.GoTo What:=wdGoToBookmark, Name:="bm1"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Copy
Workbooks("book1.xls").Activate
With ActiveSheet.Range("A1").Select
ActiveSheet.Paste
End With
End Sub
Selection.GoTo What:=wdGoToBookmark, Name:="bm1"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.Copy
Workbooks("book1.xls").Activate
With ActiveSheet.Range("A1").Select
ActiveSheet.Paste
End With
End Sub