I pasted your code and ran only the code, nothing else.
it did not stop for any error nor i saw nothing appearing on the screen.

The printer is not set as default.

The printer is shared on Windows 2003 enterprise edition server with sp1. Kix32.exe File version.4.22.0.0