3 steps:
1) Get the current procedure code element. You can use
EditPoint.CodeElement(vsCMElement.vsCMElementFunction). Notice that this
function is buggy. See
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&frame=right&th=74f52
6821382f1b9&seekm=ef1Kg3zXEHA.3716%40TK2MSFTNGP11.phx.gbl#link4
2) Once you have the CodeElement, you have CodeElement.GetStartPoint(part)
and CodeElement.GetEndPoint(part) where you pass the requested part and you
get an EditPoint. These functions have also their dosis of bugs...
3) With a TextPoint, you call TextPoint.CreateEditPoint to get an EditPoint,
and then you call EditPoint.Insert(blah blah).

Signature
Carlos J. Quintero (Visual Developer - .NET MVP)
FAQs, Knowledge Base, Files, Docs, Articles, Utilities, etc. for .NET
addins:
http://groups.yahoo.com/group/vsnetaddin/ (free join)
> I am trying to write a VB.Net 2003 addin which will find the start and end
> of the procedure in which the cursor is located and insert a block of code
> right after the procedure header and another right before the end of the
> procedure. I have tried to navigate the DTE object model with no success
> visited websites and newsgroups and examined samples. but I still don't seem
> to be able to figure this out.. Can anyone help me here?