Hi Monisha,
The InDesign C++ SDK is not easy to learn. It takes many months or years of learning and experimenting to gain the proficiency needed to accomplish what you want to do. There is no quick answer to your question.
You might want to consider hiring some help from an experienced InDesign C++ SDK developer.
There are still a few around (myself included), and you’ll probably be able to get in touch with some them on the Adobe forums, and try to find someone who has some spare time they could give to you.
Be aware that nothing in this area is easy – there are no ‘5 minute quick fixes’, and the people who know how to do this put a lot of effort into getting to that level. I don’t think any of them will be very keen on doing complex developer support for free.
P.S. Not sure what your level of proficiency is, but you might get some value out of one of my books. They’re dated now, but most of the info is still quite relevant.
https://www.lulu.com/shop/kris-coppieters/adobe-indesign-cs3cs4-sdk-programming/paperback/product-5615965.html
https://www.lulu.com/shop/kris-coppieters/feature-development-for-adobe-indesign-using-extendscript/paperback/product-5615981.html
Cheers,
Kris