first_page

Returning a Range Collection of Contiguous Paragraphs of the Same Style

It was GetSimilarStyle() then it became GetContiguousParagraphs() and finally we have GetContiguousRanges() (which, by the way, made me change GetRanges() to GetFindRanges()). The big change came when I realized that I need to account for multiple blocks of contiguous paragraphs. The old design inadvertently handled only one block.

I am chomping at the bit, eagerly looking forward to translating this code into managed code. This way of developing Microsoft Office applications cannot be beat:

  • Write the first version of the app’ on the fly in VBA. In the case of Word all code should be kept in NORMAL.DOT to prevent security problems and losing broken code in a digitally signed file.
  • Use the app in VBA for testing/debugging purposes.
  • Translate to VSTO managed code.VSTO cannot beat the edit and continue features of VBA! And when a new version of VSTO comes out with these features, I am not confident that it will allow for this build-as-you-go, informal freedom I have with old VBA.

rasx()