Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Sukhi
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I copy formatting from a template to many docs? WebColin Formatting Long Documents 1 November 18th 05 03:51 PM
How do I copy Cells in a Template? Megh Tables 4 November 10th 05 04:11 PM
Microsoft Word 2002 Template Table of Contents Problem CADMBFan Microsoft Word Help 7 September 8th 05 06:35 PM
attach a template to a document Corey Microsoft Word Help 1 December 2nd 04 01:30 AM
Why doesn't my custom template attach to my .htm file? KCS Microsoft Word Help 1 November 30th 04 03:58 AM


All times are GMT +1. The time now is 04:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"