Well you would need to do it in code somewhere, so that really depends on what your preference is - you could easily put together a windows application that would do this.
To copy the view around your code would basically be finding the view object from the source document library and then add it to each other document library. So for example, to get the view use something like this: SPList sourceDocumentLibrary; // I'm assuming this already exists - get the list from the appropriate place though SPView newView = sourceDocumentLibrary.Views["My View Name"]; And then to add it get the new library as an SPList object and parse the properties of the newView object into the SPList.Views.Add() method. That should get you started in the right direction. Brian Farnhill Consultant Technical Consulting Mobile: 0408 289 303 Fax: 02 8001 7778 Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Web: www.uniqueworld.net<http://www.uniqueworld.net> Blog: pointstoshare.spaces.live.com<http://pointstoshare.spaces.live.com/> [cid:image001.jpg@01C908FE.92175D90] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Lee Sent: Thursday, 28 August 2008 11:10 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically Which file would you create the SP View object in? Would you know the steps for doing this and how to use code to copy the view around? Thanks. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Farnhill Sent: Thursday, 28 August 2008 10:03 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically It is possible to create views from code. There are a few ways of going about it but basically you create the SPView object and then add it to the Views collection of each document library. I'm pretty sure you could create the view in one spot and then use code to copy it around (I don't think there would be any issues as long as each document library had the required columns for the view). Brian Farnhill Consultant Technical Consulting Mobile: 0408 289 303 Fax: 02 8001 7778 Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Web: www.uniqueworld.net<http://www.uniqueworld.net> Blog: pointstoshare.spaces.live.com<http://pointstoshare.spaces.live.com/> [cid:image001.jpg@01C908FE.92175D90] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Lee Sent: Thursday, 28 August 2008 10:05 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically If we have a number of existing sites that has a document library which has the same views, and one day we decide to add an additional view to the document library, is it possible to replicate that view across all the existing sites' document library? i.e. programmatically add that view to the document library on all sites, without having to manually go into each site to create that new view. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Farnhill Sent: Wednesday, 27 August 2008 7:59 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically You can add any of the fields to a view based on their internal name. For example, the internal name of the field for the documents icon is "DocIcon" and the correct field to use for the title field with the edit menu is "LinkFilename". If you are unsure what the internal name of a field is that you want to use a view, you can try this - build the view in SharePoint and then go to the 'modify this view' page. Then with the IE Dev Toolbar (or firebug if you are a fix fox user) select the check box for the field you need the internal name of. You will see that it has an onclick attribute that will look like this "javascript:ShowHideTotals(this, 'LinkFilename')". The internal name for the field the checkbox corresponds to is the second parameter in the JavaScript function. I hope that helps Brian Farnhill Consultant Technical Consulting Mobile: 0408 289 303 Fax: 02 8001 7778 Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Web: www.uniqueworld.net<http://www.uniqueworld.net> Blog: pointstoshare.spaces.live.com<http://pointstoshare.spaces.live.com/> [cid:image001.jpg@01C908FE.92175D90] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Witherdin, Nigel Sent: Wednesday, 27 August 2008 2:16 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically OK, I found a cheat of a way to do this, by cloning the "All Documents" view and removing/adding fields as I needed to. But I would still be interested in knowing how to add these "special" fields programmatically if anyone knows? Cheers, Nigel Witherdin Senior Support Analyst Eversheds Direct Dial: +44 (0) 84 549 754 17 Mobile: +44 (0) 7738 553256 www.eversheds.com<http://www.eversheds.com/> ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Witherdin, Nigel Sent: 26 August 2008 16:49 To: listserver@ozMOSS.com Subject: [OzMOSS] Setting Library View Programmatically Hi All, In a feature event receiver I am trying to create some views for a particular list as per this code: ---- //Ordered by Reference number SPViewCollection views = spLibrary.Views; StringCollection libViewFields = new StringCollection(); libViewFields.Add("File_x0020_Type"); libViewFields.Add("Reference_x0020_Number"); libViewFields.Add("Modified"); libViewFields.Add("Item_x0020_Author"); libViewFields.Add("Item_x0020_Title"); libViewFields.Add("FileLeafRef"); libViewFields.Add("Group1"); qry = "<OrderBy><FieldRef Name='Reference_x0020_Number' Ascending='True' /></OrderBy>"; libViews.Add("Ordered by Reference Number", libViewFields, qry, 100, true, false); spLibrary.Update(); ---- This is all working fine, but I would really like to add the "File Type" column so that it shows an icon for the file type, and the name (FileLeafRef) column so that it has the dropdown edit menu. Anybody have any idea how to create these view fields programatically Many thanks Nigel Witherdin Senior Support Analyst Eversheds Direct Dial: +44 (0) 84 549 754 17 Mobile: +44 (0) 7738 553256 www.eversheds.com<http://www.eversheds.com> ********* This email is sent for and on behalf of Eversheds LLP ********* This email is sent for and on behalf of Eversheds LLP which is a limited liability partnership, registered in England and Wales, registered number OC304065. Registered office One Wood Street, London, EC2V 7WS. Registered VAT number GB820704559. A list of the members' names and their professional qualifications is available for inspection at the above office. Regulated by the Solicitors Regulation Authority (see www.sra.org.uk<http://www.sra.org.uk/>). Confidentiality: This email and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this email and highlight the error. ************* [ www.eversheds.com<http://www.eversheds.com/> ] ************* ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com
<<inline: image001.jpg>>