Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Location
    Renfrewshire, Scotland
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy entire template

    I have a situation whereby I want to copy the contents of a template to a new file - including all the page setup details so that I get the change in margin settings that are on the template.

    Ideally if anyone is aware of a way that I would be able to, from a blank document, select a template to copy, copy the entire contents (text, layout and page settings) and then paste the contents to the new doc

    Thanks

    Alba

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Can you explain why you don't just use the template? What is in the new document that precludes using the template to create the doc?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    2 Star Lounger
    Join Date
    Jan 2003
    Location
    Renfrewshire, Scotland
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Andrew,

    I know it sounds stupid, however, we work with a Document Management System, that are trying to integrate it with a Digital Dictation System. One of the features of the integration between the two products is that a user can generate a document within the Document Management System from the Dictation making the process seamless for the both the person dictating and the person transcribing. We are able to link Templates to the dictations, but unfortunately we have multiple templates that can be used in each situation and the dictation product only allows a 1-1 setup.

    Therefore I was hoping that if a user could create a document with the Normal template, then run a macro to select the required template and bring over the template and the page settings. I have the code to select the template, but what I lack is the ability to copy the page layout..

    Thanks

    However, we have a number of templates (letter primarily) that are are designed with a specific page layout

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I would be inclined to copy the new doc content across to the specific template (taking care that the pasted content doesn't include a section break.

    However, page setups and header/footer info is contained in a section break so you could leverage this for an alternate method of doing this. Perhaps you could save a continuous section break for each required "page layout" and simply add the relevant one to the back of the document. This assumes the styles across all 'templates' are the same.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    I'm still not sure what you mean by page setup. Do you need to capture the margins, headers & footers, and such? Or just the layout of the text and other elements within margins?
    Pam Caswell

  6. #6
    2 Star Lounger
    Join Date
    Jan 2003
    Location
    Renfrewshire, Scotland
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By Page setup I am primarily referring to the margins. Our letter template has different margin sizes to Normal, so that when printed it will fit onto the pre-printed paper. When I copy the entire contents of the template, the layout comes over fine, but on pasting to normal, it loses the margin settings.

    Hope this makes sense..

    Alba

  7. #7
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    So far for me today, as long as the new document is empty, when I press Ctrl+a (to select everything, including the final paragraph mark), margins and header/footer also get pasted into the new document. If there's even a single character added to the document, only the text gets pasted. What I describe is what happens manually. Perhaps VBA could somehow insure that page properties from the template (which in this case is only a source document for the copy) also get copied/applied.
    Pam Caswell

  8. #8
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    So why don't you just make a copy of the template as a file, rather than trying to open and replicate its contents? The former is dead easy; the latter requires an intimate knowledge of everything in the template - including vba projects, customised building blocks, etc, not just page layouts - they're the 'easy' part.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  9. #9
    New Lounger
    Join Date
    Jun 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I were designing a solution to this problem I would do as Andrew suggested - move the text into the template. Trying to create a macro to reproduce the margins and other page settings is complex and runs a high risk of missing some of the settings.

    Instead, you could create a macro that selects all, copies the selected text, then selects a template, creates a new document based on that template, and pastes the copied text. That way you don't risk losing any of your template settings.

    Would that work in your situation?

Posting Permissions

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