Sure. You would have to query the database that is published and look in the sysarticles table. You could pull all the pertinent information into variables from that table and syspublications and build a string to execute sp_droparticle.
Can I ask why you are looking to make this dynamic though?
David
@SQLTentmaker“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot