View Single Post
 
Old 03-02-2010, 02:05 AM
zippyaus zippyaus is offline Windows XP Office 2003
Novice
 
Join Date: Mar 2010
Posts: 1
zippyaus is on a distinguished road
Default Macro to determine attached template

Hi

N00b question.

I am trying to create a print macro that will determine what template the document is attached to and based on that print single sided or duplex.

In plain text

If document template is C:\Program Files\Microsoft Office\Templates\Label.dot print single sided else
if document template is C:\Program Files\Microsoft Office\Templates\Letter.dot print duplex

I have go the printing part sorted

Code:
Sub PrintDuplex()

    Dim iDuplex As Long

    iDuplex = GetDuplex     'save the current setting
    SetDuplex 3             'set for vertical binding
    ActiveDocument.PrintOut Background:=False
    SetDuplex iDuplex       'restore the original setting

End Sub

Sub PrintSimplex()

    Dim iDuplex As Long

    iDuplex = GetDuplex     'save the current setting
    SetDuplex 1             'set for vertical binding
    ActiveDocument.PrintOut Background:=False
    SetDuplex iDuplex       'restore the original setting

End Sub
Is it possible to determine the template path via a macro call?

Any help would be greatly appreciated
Reply With Quote