I've had a bit of a bash at this sort of thing for work. It sounds like you are having very similar problems with the incomprehensibly incomplete help files available. In truth I only got this going through trial and error!
My only hint, use Set lots!
Sub main()
Set swApp =...