[Word]Inserting a building Block Last Page
Hi i am trying to insert a building block on the last page of the MSWord Doc. I am not sure if I am getting the correct range for the last page. i am still new with word. Here is my code. I first get the building block and the create a new page and on that new page I created I want to insert the building block. The code so far.
Thank you.
If insertAnalyst Then
Dim oBlock As BuildingBlock = moParentWordManager.BuildingBlockManager.GetBuildingBlock
("BJMUnapprovedBuildingBlocks.dotx", "TestBuildingBlock")
If Not oBlock Is Nothing Then
Dim oRange As Range =
moDocument.Range(CObj(moDocument.Range().Start), CObj(moDocument.Range().End))
oRange.InsertBreak(WdBreakType.wdPageBreak)
oBlock.Insert(oRange)
End If
End If