LOCAL loComponent AS VBIDE.VBComponent WITH THIS.odocument.VBProject ************************************************************* * Grab the right module ************************************************************* loComponent=.NULL. FOR lnComponent = 1 TO .VBComponents.COUNT IF UPPER(.VBComponents(lnComponent).NAME) == "THISDOCUMENT" loComponent = .VBComponents(lnComponent) EXIT ENDIF ENDFOR ENDWITH RETURN loComponentOnce you get that far, you want to look at the CodeModule member of the component.