Tag Info

Hot answers tagged

6

This problem is caused by differences in the SourceID property of the metadata fields. If you compare the value of SourceID on a field of a content type in one library with the same field of a content type in another library you will see that they differ, and they are used inside the Word document when referencing the metadata field. The solution is to set ...


5

After some researching I found this blog addressing "Could not open (url)": http://petervdberg.blogspot.com/2011/01/how-to-enable-save-and-send-option-in.html If you are using Windows 2008R2 this could be solution. I checked my machine and 'Desktop Experience' feature was already installed so I was unable to reproduce your problem.


5

Just retrieve the template as an SPFile and use the OpenBinary() method to get the byte[]. Then copy that to your new file. Edit. The template is not actually bound to your list but to a content type, so you need to retrieve it using its url: byte[] f = w.GetFile(web.Lists[YourList].ContentTypes[yourContentTypeId].DocumentTemplateUrl).OpenBinary();


4

You can do this with a custom Content Type using the Document Content type, and setting a document library to use this content type. The fields you add to the custom content type (that inherits from Document, remember), will show in the Document Information Panel in Word, and you can add them as Quick Parts in the document. Save it as a template and ...


4

I had the same issue. All you have to do is just to save the document template (dotx) as word document (docx ).


3

The following fix should resolve the issue: http://www.microsoft.com/downloads/details.aspx?FamilyId=17C36612-632E-4C04-9382-987622ED1D64&displaylang=en What platform are you running on?


3

Try something like that - to create your word file. Word.Application app = new Word.Application(); Word.Document doc = app.Documents.Add(@"http://...PathToMyWordTemplate.dotx"); doc.SaveAs(FileName: @"c:\test.docx"); You can save the document in memory and pass his byteArray to the docLib.RootFolder.Files.Add... method. Below is a codesnippet to add ...


3

Go to Library Settings -> Advanced settings -> Set Allow management of content types? to Yes -> click OK button Site settings -> Site content types -> Create -> Enter Name (f.e. PowerPoint), add description -> Select parent content type from: Document content types -> Parent Content Type: Document -> click OK button -> click on Advanced settings link -> ...


3

I've just made a small test of difference ways to create a word document in the file system and then use it to programatically create documents in a document library with properties. Create not using SharePoint Create document/template from scrach in Word. Add Custom properties. Add Quick Part using Field|DocProperty|Property. Save to file system Result: ...


3

This can be done, but you need to use one Content Type for each template needed. Create a new content type. Give it whatever name you would like, but set dropdown properties as defined. Would suggest to define a group name for these content types (I used Test Type with Template). Next go to the Advanced Settings for this new content type. This is ...


3

God bless Reflector!! Maybe I should have tried this one earlier rather than that crappy* “Import SharePoint Solution Package” tool that led me down the garden path!! I had been trying to add the document template file to a folder and document in the _cts folder like the “Import SharePoint Solution Package” tool (and every other blog site) was doing and ...


3

Take a look at http://office.microsoft.com/en-us/sharepointserver/HA101734541033.aspx?pid=CH101779691033 for the detailed description of how to use Content Types with Document templates. In general, you can associate your own templates with each Content type so that end users don't start with blank files when creating typical documents.


3

You can set the order of the Content Types used inside the document library settings. Site Settings > View all site content > Your DocLib > Settings > Document Library Settings > In Content Types section click "Change new button order and default content type" Here you can hide content types you no longer want to display for the end user and set the order ...


3

This is one of those things that Microsoft should have made better, but hasn't yet. I tried your way, and extended it further by deleting the default content type from the library after I've added my new custom content type to the library. The new button fails, and you get an upload dialog instead. Very bad User Experience since I wanted to create a new ...


2

To keep things simple you can build one content type for each language and add corresponding language template to it. First you should build top content type with some shared columns (address, name, country etc.). Each language content type should be inherit from it and by doing so each language content type will contain same shared columns (good for ...


2

What I would do is create a parent content type ("MY Content Type") and then create 3 children MyContentTypePT MyContentTypeEN MyContentTypeFR You can manage the fields for all three with MyContentType but associate a different template to each.


2

Now to do the same thing with code. I am taking from your question, that you can create the custom content type in code. Just in case, here are links to two options, one through code and using the list definition. I am also going to guess that you need to deploy this using a feature, which is why you need to use visual studio. The code option makes the ...


2

It is IE security issue and here is similar question with an answer on Server Fault: http://serverfault.com/questions/59110/sharepoint-error-message-some-files-can-harm-your-computer Check Why is Word document created from template saved locally, instead of to the document library? for some additional info but generally it cannot be done


2

No, this is to my knowledge not possible. Instead create a hierarchy of CT's where all your different templates are associated to a sibling CT


2

Here is simple example how to setup Document Library template via code: using (SPSite site = new SPSite("http://mycoolsite")) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["MyLibrary"]; SPDocumentLibrary docLib = (SPDocumentLibrary) list; docLib.DocumentTemplateUrl = ...


2

Not 100% sure what you mean by "She wants the document opened as a new (macro enabled) document as if the word template were opened in Windows Explorer", but what I think you need is Content Types. Create a custom Content Type (based on the Document content type as the parent) for each document template you want to have. Then in the Content Type settings ...


2

Is your requirement to hide the action or prevent users from creating new lists in the SharePoint site? You could prevent users from creating lists by making them a contributer or create a custom permission level. You can use the SPRoleDefinition class to programmatically create a permission level. Take a look at ...


2

below is the code... which working perfectly in my system.. public void UpdateAndCreateFile(SPWeb web) { try { SPSecurity.RunWithElevatedPrivileges(delegate() { string TemplateUrl = string.Empty; try { TemplateUrl = "Your Document templated full ...


2

I no in your post you said "without an external application" but does that include js libraries? Below is a simple solution that will copy a document from one SP library to any other SP library. I have not verified its cross-site scripting capabilities but it theoretically should work across farms, domains, and different SP versions. (It 100% works across ...


2

I had a similar scenario where we wanted to track certificates of completion for things. I used option 2. The data was stored in a list and I had just created a simple "certificate page" that had some query string params in it to fetch the proper data (custom data view web part). It would fill in all the blanks based on the list data. The page had a simple ...


1

If the custom property that you want to put into a word table has (or could have) separators for each "table row", then you can write a simple word macro in vba to parse the custom property into your table.


1

I believe Property promotion and demotion will only occur when a document is uploaded or downloaded via the SP web UI or via WebDav (folder open in Windows Explorer for example).


1

Check out my answer here: Set the Document Template of a Document Library programmatically I think you can easily convert code provided there to PowerShell (if not let me know). Also be sure to read additional info.


1

According to office.microsoft.com, you can use the slide master in the target slide deck, but you must clear the option "Keep Source Formatting." I have verified this works for me. I also see it confirmed in another office.microsoft.com article on slide masters.


1

Document Set is what you are looking for. To elaborate, you can associate metatdata to a document set and have multiple templates associated with it.



Only top voted, non community-wiki answers of a minimum length are eligible