Apologies. I don't check the actual printout statement as I don't want to waste reams of paper.
The help page for printout is here
https://msdn.microsoft.com/en-us/VBA...ut-method-word
I suspect the problem is that the pages parameter should be a variant but we are passing a string.
Try changing to
pages:=Cvar(my_form.txtPages)