In an ordinary document list in SharePoint 2010 there are two buttons for adding documents: “New document” and “Transfer documents”. New document usually opens a blank word document, and Transfer documents usually gives the possibility to choose a document to add to the list.
In a document library in our environment, the New document button opens the form to upload an existing file rather then open an empty word document.
Why does this happen? Is there a setting that specifies this behavior?
It happens when there are no default templates, possible due to custom content types with no set default document template (word, excel, etc) pherhaps due to upgrade from SP 2007 to 2010?
Quick fix: Add document template to the custom content type and add document should reappear.
Related
Sean W 2104 post Auto displaying form on opening a template file, dotm from explorer demonstrated how to show my form when my .docm document loads.
Timothy Rylatt's response to my vba word 2016 saveas document without changing module name suggested I render my .docm as .dotm template.
However, though my .docm shows my first form on startup, opening the .dotm does not. The .dotm only shows only the underlying document (that the forms populate).
So is it that my forms (and their VBA code) do not belong in the template document they fill? Do I instead need to load a template document that doesn't contain the forms? If so, do I create a dummy .docm document whose only purpose is to house the forms (and their VBA code?) If so, what do I do with the document from the dummy? Hide it? And what does my prospective client open?
You do not name your procedure Document_Open in your template but rather Document_New.
You are not opening the template, but rather creating a new document based on that template. Here is my writing on Auto Macros in templates.
You could also name the procedure AutoNew and place it in the another module of your template.
Some background first. Im creating VBA script to transform one Word document into another one. I developed a script and put it into dotm template file.
First appication is using this template to export data. Next script in this template transforms exported data into new document. This template is also used to create result document. This means that all styles, scripts and custom ribbon UI is available in result document.
What I need is to remove scripts and custom ribbon UI from result document.
I was able to remove scripts but I don't know how to access and remove or hide custom ribbon UI from result document.
Any hints? Btw I don't want to put any script in result document which means that script from template have to delete or hide custom robbin UI from result document.
When you create the target document Word will use the current attached template. You need to specify a different template e.g. Normal.dotm. (assuming you are not developing your scripts in Normal.dotm.
I created a Word 2010 template with macros and VBA code but then I amended one of the documents created from the template instead of the template and this included text boxes and drop down lists. How do I save the document as a new template with the macros maintained as well as the VBA and components such as text boxes etc. When I try and save the document as a .dotm file the option to place in Design Mode doesn't work and I have took the document out of Compatibility Mode.
Here is the situation :
- Created a web-enabled form using InfoPath and published it to the Sharepoint site as a content type named PAF Cost , uploaded the model form as well in a library on the site.
- Created a document set named PAF, which containes the PAF Cost splitting content type.
- Created a library Forms in which i allowed the document set PAF content type
When I create a new document set say PAF1, i go inside it and i go to the ribbon document/new document command and i can create one new PAF Cost frame. I can edit this form through the web interface which is correct.
Now i want this form to be automatically created when i create a new document set PAF1,
To do this i specified a template for the default content type in the document set PAF settings, and i give the .XNS form file as a template. The form gets automatically created in the document set, but when i click on it it launches Infopath, and does not open as a web form. The icon as well is different from the manual y created form which open as a web form.
How can i make this automatically created form to open as a web form ?
I haven't found a way to make it work with a .xns as template. But if you specify the .xml (just creat an empty form in the library, it's an -xml with the .xns as reference) as the template within the documentset it works fine.
(Same goes for infopath documents created from code - I hade to use the .xml as template, to have it open in thw browser by default.)
When I create a new document based on a template (*.dot), I need to know on which template is the document based on.
Is there a way to find out with VBA which template was used for creating this new document? I need the complete path to the template.
ActiveDocument.AttachedTemplate.FullName
You may also use a built-in document property to access the template name: ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
I don't remember why theres has been sometimes differences between the two results; you must try it out. please be aware that accessing sometimes the built-in properties sets the document in a dirty state, so that it is useful to save the ActiveDocument.Saved state before and reset it after having accessed the property.
[UPDATE]
I've had again a look into the way you're creating the documents. If it's at your customer with 38.000 templates, I guess your problem are "fake" templates. I've just did a test with Office 2003:
Create a new document "TestTemplate.doc" with same content and save it as doc file. Close it.
Go to Windows Explorer and rename the document to "TestTemplate.dot". This provokes Windows Explorer to treat it as a template, not as a document. The default DDE command for templates is not "OPEN", but "NEW", what you can also see if you do a right-click on the file ("New" is bold, while with documents "Open" is bold).
Double-click the fake template: Word creates a copy of the document, so a new file named "Document2" or whatsoever.
Go to the VBA Editor, and type ?ActiveDocument.AttachedTemplate, and you'll see "Normal" as answer. Type ?activedocument.Type = wdTypeTemplate and you'll see "False" as answer.
Sp I guess the documents "Without template" are only copies of other documents, and not of templates. So you have no way to find the base template.