in reply to What is the perl equivalent of vba

Since each Office Application has its own API you'll need to tell us if this is Word, Excel or PowerPoint... then we'll maybe be able to help.