Keep template margins setting when saving

  • Hello,


    I have a code that saves a copy of a template in several files. Its work really well but it doesn't keep the margin setting on the saved document. When we have to go in and reprint that document we always have to reset the margins or it will print on multiple pages.


    How can this code be modified to save margins as they are set in the template?


  • Re: Keep template margins setting when saving


    Try this

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Keep template margins setting when saving


    I modified the code just before your last post (code had a typo), make sure you try the modified code!

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Keep template margins setting when saving


    I'm getting and error message "Object doesn't support this property or method" and highlights this row...


    Code
    dMTop = .TopMargin
  • Re: Keep template margins setting when saving


    Sorry, my mistake, change the code to this

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Keep template margins setting when saving


    Good morning,


    I finally got a chance to test the code and it is still not saving it with the original margins. It still shows up on two pages when I open the saved document.

  • Re: Keep template margins setting when saving


    It could be because the Paper Size that the Template Page Set-up is set to is different from the default Paper Size. Try this


    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Re: Keep template margins setting when saving


    Good morning KjBox,


    It's giving me an error on the following line...


    Code
    PapSize = .XlPaperSize

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!