Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-06-2014, 06:58 AM
Cosmo Cosmo is offline Creating a new document from a template screws up fields! Windows Vista Creating a new document from a template screws up fields! Office 2007
Competent Performer
Creating a new document from a template screws up fields!
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default Creating a new document from a template screws up fields!

I have come across a major issue with a VBA I am working on. I have been working on this project as a document file, but when I save it as a macro-enabled template (.dotm) , it screws up the fields (MergeFields) when creating a new document. Example, the header of the document has address fields:

«primary_name»
«primary_address»
«primary_city» ...etc.
«primary_contactname»:

but when the document is saved as a template file and a new document is created from that template, many of the fields are replaced by the user first name field (another MergeField used later in the document), and the city field has an extra opening tag (so it doesn't get replaced in the VBA code):



«user_first_name»
«user_first_name»
««primary_city» ...etc.
«user_first_name»:

I have tried deleting and replacing the fields, and the problem still persists. I even deleted the "user_first_name" field in the only place it existed in the document, and the fields are still replaced by it, even if it isn't in use anywhere else. Can anyone explain why this is happening? If I open the template via the file open in the Word application, then it opens fine, but if I open it by double clicking the file icon, the fields are wrong.

How can this be fixed?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a new document from a template screws up fields! When creating new template from established template macros getting lost. TechEd Word 3 06-09-2014 07:22 PM
Creating a new document from a template screws up fields! Help with creating a Word document that is like a template Nurse2014 Word 2 08-18-2013 01:22 PM
Protected Fields in a document template augurswelljan Word 3 05-01-2012 04:45 AM
Creating a new template for existing document? Stephen0352 Word 6 09-12-2011 09:00 AM
Creating document from template but macros are still linked to template webharvest Word 0 07-16-2011 09:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:51 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft