Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Disable macro based on template used

    Hi there
    I have a macro that automatically runs on SAVE that inserts a document ID in the footer of the document. This is problematic when someone saves labels because the ID forces the last row of labels to the next page.
    Is there a way to not execute the macro if the template used to create the document is Label.dotx?
    Thanks in advance for any help.
    Deanna

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Deanna,

    Change your save macro to include:
    Code:
    If Not ActiveDocument.AttachedTemplate = "Label.dotx" Then
     '*** Place your footer code here ***
    End if
    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    New Lounger
    Join Date
    Jul 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I'll give that a whirl. Thanks for your quick reply!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •