Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Attach template does not copy contents
Hello everyone
I create new document from custom build template -- "objWord.Documents.Add Template:=strPath.... Then I need to add some more text to document depending on certain conditions, which I saved as 3 different templates (couple of pages each). When I attach template:-- objWord.selection.insertbreak wdpagebreak objWord.ActiveDocument.AttachedTemplate = Template name I dont see any of my text. However, if I am creating new document with any of above templates, its ok. I need to have all of it in one document, starting new page for each template, because user just need to press print and post. please be rest assured that your help is greatly appreciated. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Attach template does not copy contents
Attaching a template to a document provides styles, AutoText, macros, and
toolbars. It does not add document-level formatting (page layout) or content. To get these, you must create a new document based on the template and insert your file into it. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Sukhi" wrote in message ... Hello everyone I create new document from custom build template -- "objWord.Documents.Add Template:=strPath.... Then I need to add some more text to document depending on certain conditions, which I saved as 3 different templates (couple of pages each). When I attach template:-- objWord.selection.insertbreak wdpagebreak objWord.ActiveDocument.AttachedTemplate = Template name I dont see any of my text. However, if I am creating new document with any of above templates, its ok. I need to have all of it in one document, starting new page for each template, because user just need to press print and post. please be rest assured that your help is greatly appreciated. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Attach template does not copy contents
On Sat, 4 Feb 2006 06:11:39 -0800, "Sukhi"
wrote: Hello everyone I create new document from custom build template -- "objWord.Documents.Add Template:=strPath.... Then I need to add some more text to document depending on certain conditions, which I saved as 3 different templates (couple of pages each). When I attach template:-- objWord.selection.insertbreak wdpagebreak objWord.ActiveDocument.AttachedTemplate = Template name I dont see any of my text. However, if I am creating new document with any of above templates, its ok. I need to have all of it in one document, starting new page for each template, because user just need to press print and post. please be rest assured that your help is greatly appreciated. You misunderstood the meaning of "attach template". That operation does not transfer any text from the template to an existing document; all it does is make styles, autotext, and macros available. Your macro should use the Documents.Add command to make a new document based on the template, and then copy the text from that document to your existing one; then you can discard the new document (close it without saving it). This article explains in more detail: http://www.shaunakelly.com/word/atta...ate/index.html -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Attach template does not copy contents
Hi ?B?U3VraGk=?=,
When you attach a template, the only thing that happens is that your document links to the AutoText, macros, toolbars and keyboard shortcuts stored in the template. Optionally, you can also pick up the template's styles. What does NOT happen (and there is no facility in Word for this) is bringing across anything contained in the TEXT. That only happens when you create the document from the template. Perhaps what you need is InsertFile? Or to save the additional text as AutoText entries and insert those? I create new document from custom build template -- "objWord.Documents.Add Template:=strPath.... Then I need to add some more text to document depending on certain conditions, which I saved as 3 different templates (couple of pages each). When I attach template:-- objWord.selection.insertbreak wdpagebreak objWord.ActiveDocument.AttachedTemplate = Template name I dont see any of my text. However, if I am creating new document with any of above templates, its ok. I need to have all of it in one document, starting new page for each template, because user just need to press print and post. please be rest assured that your help is greatly appreciated. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I copy formatting from a template to many docs? | Formatting Long Documents | |||
How do I copy Cells in a Template? | Tables | |||
Microsoft Word 2002 Template Table of Contents Problem | Microsoft Word Help | |||
attach a template to a document | Microsoft Word Help | |||
Why doesn't my custom template attach to my .htm file? | Microsoft Word Help |