vba - Print error in Word 2013 -


i have print macro sends first page our letterhead printer , remaining pages plain paper printer. document printed second time on plain paper our records. while macro worked when using xp , word 2010, after recent upgrade windows 7 , office 2013, macro crashes entire word application. is, if run macro, word crashes. if step through macro, works fine. macro used multiple time day , hate lose due recent upgrade.

any ideas save macro?

macro code below which assign keyboard shortcut of ctrl+shift+p

thank you

public sub letterheadprint()     ' sends page 1 letterhead printer (\\scprint04\ashplj5)     ' sends page 2 regular printer (\\scprint04\astaxbill)     ' prints copy on plain paper      on cancel goto cancelled:     on error goto cancelled:      ' save current printer     dim scurrentprinter string     scurrentprinter = application.activeprinter      ' print assessee copy     ' page 1 letterhead printer     application.activeprinter = "\\scprint04\ashplj5"     activedocument.printout range:=wdprintfromto, from:="1", to:="1"      ' remaining pages regular printer     application.activeprinter = "\\scprint04\astaxbill"     activedocument.printout range:=wdprintfromto, from:="2"      ' print office copy     activedocument.printout  cancelled:      'restore original printer     application.activeprinter = scurrentprinter  on error goto 0 end sub 

ctrl+shift+p font size select, problem

option explicit public sub letterheadprint()     ' sends page 1 letterhead printer (\\scprint04\ashplj5)     ' sends page 2 regular printer (\\scprint04\astaxbill)     ' prints copy on plain paper      dim cancel integer     application.screenupdating = false       on cancel goto cancelled:     'on error goto cancelled:       ' save current printer     dim scurrentprinter string     scurrentprinter = application.activeprinter      ' print assessee copy     ' page 1 letterhead printer     application.activeprinter = "ashplj5"     activedocument.printout range:=wdprintfromto, from:="1", to:="1"      ' remaining pages regular printer     application.activeprinter = "astaxbill"     activedocument.printout range:=wdprintfromto, from:="2"      ' print office copy     activedocument.printout  cancelled:      'restore original printer     application.activeprinter = scurrentprinter     application.screenupdating = true  on error goto 0 end sub 

global.activeprinter property (word)

documents created in earlier version, such word 2010, open in compatibility mode in word 2013, open , save new version

i suggest installing latest version driver , office updates


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -