We describe the design and construction of a laser scanning confocal microscope with programmable beam forming optics. The amplitude, phase, and polarization of the laser beam used in the microscope can be controlled in real time with the help of a liquid crystal spatial light modulator, acting as a computer generated hologram, in conjunction with a polarizing beam splitter and two right angled prisms assembly. Two scan mirrors, comprising an on-axis fast moving scan mirror for line scanning and an off-axis slow moving scan mirror for frame scanning, configured in a way to minimize the movement of the scanned beam over the pupil plane of the microscope objective, form the XY scan unit. The confocal system, that incorporates the programmable beam forming unit and the scan unit, has been implemented to image in both reflected and fluorescence light from the specimen. Efficiency of the system to programmably generate custom defined vector beams has been demonstrated by generating a bottle structured focal volume, which in fact is the overlap of two cross polarized beams, that can simultaneously improve both the lateral and axial resolutions if used as the de-excitation beam in a stimulated emission depletion confocal microscope.