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 ...


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

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

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

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 ...


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

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

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 ...


1

While you are publishing to the Library there is a step (the step after you finish choosing the library you wish to publish to) in the wizard that you can use to map Fields from the form to those on the library. Now I am not sure if you can craete those columns on the fly, so your better off creating those columns first and then try publishing and mapping ...


1

If you are willing to do a one time tedious job: Create a content type at the Home Page (site collection level). Home -> all settings -> site content types. Set it to utilize your template by going to advanced settings. You can either upload your template here which means you will have to come back here to edit it or you can upload it to a document library ...


1

There is an article that describes a similar problem (it's about excel templates) and some workarounds. http://bizsupport1.austin.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&taskId=110&prodSeriesId=1840603&prodTypeId=18964&objectID=c03474919 I haven't tried all these workarounds but it may get you started. I am dealing ...


1

Yes, you can do it. But, this requires you to configure a document library to use your departmental templates for creating new documents such as Letterheads other 'pre-defined' templates etc. Define your base templates? Ask yourself question if you need to reuse this template in another site etc? Create your custom Content Types within the site they will ...


1

You also need to duplicate the template inside the folder library itself. Here is a nice artile on how to do it. Also you need to add DocumentTemplate and Folder nodes to the schema.xml in the respective content type. Update: After reading the comments did a test and this is what worked for me. <ContentType ID="0x0101004b60f7c3b1ba437f8853236e9bbb3903" ...


1

It's possible move to document library follow @james 's answer if you need keep the data in list and users create and edit the data in list, document library is just a attachment lib. you can flow the additional steps: create a column in the list to storage doc URL.(i think the column type should by URL) write eventhandler to sync data from list to lib. ...


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

We face the same problems in the word template document libray: 1- popup messag when click add new document " Some files can harm your computer. If the file imformation below looks suspicious, or you do not fully trust the source, do not open file." 2- Cannot upload the file to the Shared document (when i click save > click ok > the shared document open ...


1

Good question! Interesting one also! I would start by reading this article on how to create a DocumentTemplate and see if it fits your needs. That would make your .nc file to open in the right application. The only problem is that I don't think you can poll the client computer to see if the required application is installed. Microsoft does it by creating ...



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