D
dr mabuse
Hi -- I'm trying to figure out how to solve this problem: I have some
code that runs from Excel that inserts (pastes) an Excel range into a
Word document. However, because I have to email the document out each
month, I'd like to delete the previous months range before inserting
the current month. Here's the code that gets the Excel range into
Word:
Wkb.Sheets("Summary").Range(stRangeName).Copy
On Error Resume Next
Set wdApp = New Word.Application
With wdApp
.Documents.Open Filename:=stDocName
With .Selection
.EndKey Unit:=wdStory
.TypeParagraph
.Paste
End With
.ActiveDocument.Close SaveChanges:=True
End With
What I think should happen is that the previous months insertion should
be deleted before the current months range (stRangeName) is copied.
Any help or suggestions about how to do that would be appreciated.
code that runs from Excel that inserts (pastes) an Excel range into a
Word document. However, because I have to email the document out each
month, I'd like to delete the previous months range before inserting
the current month. Here's the code that gets the Excel range into
Word:
Wkb.Sheets("Summary").Range(stRangeName).Copy
On Error Resume Next
Set wdApp = New Word.Application
With wdApp
.Documents.Open Filename:=stDocName
With .Selection
.EndKey Unit:=wdStory
.TypeParagraph
.Paste
End With
.ActiveDocument.Close SaveChanges:=True
End With
What I think should happen is that the previous months insertion should
be deleted before the current months range (stRangeName) is copied.
Any help or suggestions about how to do that would be appreciated.