Hi all,
I'm creating a bunch of letters in one giant word document and the letters are comprised of tables. When a new letter is required I'm trying to get the first table for the letter to show up on a new page in word as it's required to be a new letter, at the moment it's just pasting the first table right below the letter before it. I was hoping there was a trick with this code that will push the table I want to the next newest page? I've tried some stuff but I think it's the range that is stopping it from happening, any suggestions???
Thanks!
Sub CopyTableToEnd(wd As Word.Document, oWordTbl As Object, w As Word.Application)
Dim rngTableTarget As Word.Range
Set rngTableTarget = wd.Content
rngTableTarget.Start = wd.Content.End
rngTableTarget.FormattedText = oWordTbl.Range.FormattedText
End Sub
I'm creating a bunch of letters in one giant word document and the letters are comprised of tables. When a new letter is required I'm trying to get the first table for the letter to show up on a new page in word as it's required to be a new letter, at the moment it's just pasting the first table right below the letter before it. I was hoping there was a trick with this code that will push the table I want to the next newest page? I've tried some stuff but I think it's the range that is stopping it from happening, any suggestions???
Thanks!
Sub CopyTableToEnd(wd As Word.Document, oWordTbl As Object, w As Word.Application)
Dim rngTableTarget As Word.Range
Set rngTableTarget = wd.Content
rngTableTarget.Start = wd.Content.End
rngTableTarget.FormattedText = oWordTbl.Range.FormattedText
End Sub