macro - find object text and replace

hi.  I'm trying to put together a macro that will search for an object with the label PNUMTOT and replace it with the total number of pages.  any help is 'preesh.