Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
developer
active.documents
automation
binary.file_format
clipboard.dde
com.add_ins
hosting.controls
internet_other
office.sdks
officedev
officedev.other
outlook.forms
outlook.vba
smarttags
vba
web.components
  
 
date: Wed, 14 May 2008 07:40:03 -0700,    group: microsoft.public.office.developer.vba        back       


How to attach word template (.DOT) in Ms Office 2007 through VBA C   
Problem:
	Want to Attach the word template with all its macroS, which was created in 
msword 2003, in MSOffice-2007 word document through VBA code. 

Problem Facing:

I had already created a template 'xyz.dot' which contains few macros also,in 
msword 2003 and save it in C:\template\xcz.dot.

but now we are using msoffice 2007.

To open a word document template in my application,I had written VBA code to 
attached a template.

below is following code:

                 - - - -
	 - - - - 
        
        ActiveDocument.UpdateStylesOnOpen = False
        ActiveDocument.AttachedTemplate = "C:\template\xcz.dot"
        ActiveDocument.XMLSchemaReferences.AutomaticValidation = True
        ActiveDocument.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = 
False

	 - - -
	 - - -


 Got an OLE Automation ERROR "Command Failed" during the execution of code 
line --   ActiveDocument.AttachedTemplate ="C:\template\xcz.dot"


 Required:
 Now we are using MSOFFICE 2007 so I need to open ,the word template + with 
all its defined macros, which was created in MSOFFICE-2003, through VBA code.
date: Wed, 14 May 2008 07:40:03 -0700   author:   Arpit

Re: How to attach word template (.DOT) in Ms Office 2007 through VBA C   
Double-check your file name. Word 2007 uses 4 character file
extensions, so it probably changed to *.docm.

Cliff Edwards
date: Thu, 29 May 2008 00:08:06 -0700 (PDT)   author:   ward376

Re: How to attach word template (.DOT) in Ms Office 2007 through VBA C   
*.dotm for macro-enabled templates...

Cliff Edwards
date: Thu, 29 May 2008 00:11:01 -0700 (PDT)   author:   ward376

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us