Custom Property in Microsoft Word 2010 Document Template and Sharepoint 2010 Content Type not Syncing up

I wrote a macro in a Word 2010 template with a custom property called HeaderFooter (a Yes/No value). When the property is changed to No, the header and footer are hidden, otherwise, the header and footer are displayed.
I added the template to a SharePoint 2010 Document library, with a content type DocInformation and a column name HeaderFooterOffOn that I want to map to the custom property HeaderFooter in the Word Document.
The macro isn't working in SharePoint, though, because when the user clicks on the HeaderFooterOffOn in the DIP of the Word Document, the Word Custom Property (HeaderFooter) isn't changing with it.
How do I get these two synced up, so that when the SharePoint column is changed, the Word Document's custom property simultaneously updates with it?

Hi kevinkevinc,
There is no direct way to run macro in SharePoint
As a workaround, I suggest you use SharePoint Event Receiver to run some custom code when column changed.
Here is a similiar thread for your reference:
http://social.msdn.microsoft.com/Forums/office/en-US/249249e2-3263-4001-86fa-bda342d95f35/run-word-macro-on-newly-uploaded-sharepoint-word-documents?forum=sharepointdevelopmentlegacy
More information:
SharePoint Event Receiver:
http://msdn.microsoft.com/en-us/library/ee231563.aspx
http://msdn.microsoft.com/en-us/library/ff398052.aspx
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Zhengyu Guo
TechNet Community Support

Similar Messages

  • Using a PDF as a Document Template in SharePoint 2010: "New Document" icon and action

    Hi,
    I have to create a document template in SharePoint 2010 using a PDF. After much searching I have learned to install Reader on the SharePoint server to bring in AcroPDF.dll
    and set the OpenControl for PDFs in DOCICON.xml to be "AdobeAcrobat.OpenDocuments".
    After taking these steps I can check PDFs in and out of SharePoint, and edit PDFs as I would edit an MS Office document.
    However two problems remain with creating new documents based upon a PDF document template.
    1) The PDF icon does not appear in the New Document dropdown. This makes sense since I never referenced a 32x32 icon in the SharePoint config files. Where would I place the icon image file and which configuration file would I edit to use that image file, and how?
    The last three document templates are PDFs.
    The second problem I face is that when I click one of the document templates above that is a PDF, nothing happens. I have tried this with Acrobat installed on both the client and the server. It would be preferable to insert a copy of the PDF document used as a template without having to use Acrobat at all.
    Is there any resolution to either of these problems?

    According to what i found the image needs to be 16x16.
    See if this works.
    Edit the DOCICON.XML file to include the PDF icon
    In Windows Explorer, navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
    Edit the DOCICON.XML file (I open it in NotePad, you can also use the built-in XML Editor)
    Ignore the section <ByProgID> and scroll down to the <ByExtension> section of the file
    Within the <ByExtension> section, insert a <Mapping Key=”pdf” Value=”pdficon_small.gif” /> attribute. The easiest way is to copy an existing one – I usually just copy the line that starts <Mapping Key=”png”… and replace the parameters for Key and Value (see image below for example).
    Note: Do not take shortcuts and copy/paste from here. 99% of problems with PDF icons not being displayed are due to errors made in the DOCICON.XML file
    Save and close the file
    Source:
    http://www.sharepointsharon.com/2010/03/sharepoint-2010-and-adobe-pdf/

  • Create folder in Document Library using Sharepoint 2010 Client Object Model

    I would like to check for the existence of a folder in s Sharepoint 2010 Document Library and if the folder is not found, create it. (I would then subsequently programmatically upload documents to that folder -- which I have figured out). Can someone
    please help me figure out how to check for the extistence of and then create a folder using the Sharepoint 2010 Client Object Model?

    You can use this:
    public static void CreateFolder_ClientOM(string listName, string folderName)
    ClientContext clientContext = new ClientContext("http://basesmc2008");
    Web web = clientContext.Web;
    List list = clientContext.Web.Lists.GetByTitle(listName);
    clientContext.Load(clientContext.Site);
    string targetFolderUrl = listName + "/" + folderName;
    Folder folder = web.GetFolderByServerRelativeUrl(targetFolderUrl);
    clientContext.Load(folder);
    bool exists = false;
    try
    clientContext.ExecuteQuery();
    exists = true;
    catch (Exception ex)
    if (!exists)
    ContentTypeCollection listContentTypes = list.ContentTypes;
    clientContext.Load(listContentTypes, types => types.Include
    (type => type.Id, type => type.Name,
    type => type.Parent));
    var result = clientContext.LoadQuery(listContentTypes.Where
    (c => c.Name == "Folder"));
    clientContext.ExecuteQuery();
    ContentType folderContentType = result.FirstOrDefault();
    ListItemCreationInformation newItemInfo = new ListItemCreationInformation();
    newItemInfo.UnderlyingObjectType = FileSystemObjectType.Folder;
    newItemInfo.LeafName = folderName;
    ListItem newListItem = list.AddItem(newItemInfo);
    newListItem["ContentTypeId"] = folderContentType.Id.ToString();
    newListItem["Title"] = folderName;
    newListItem.Update();
    clientContext.Load(list);
    clientContext.ExecuteQuery();
    Blog | SharePoint Field Notes Dev Tool |
    ClassMaster

  • When add a people picker (user column) in Word document (Template) and try to add a name it stuck!

    When add a people picker (user column) in Word document (un the document Template) and try to add a name it stuck!
    Is it a known issue?
    keren tsur

    Hi,
    According to your description, I have tested in my environment and I  have the same behavior.
    Only if you type the wrong name in the first time, then you click the phone book to search the right name and save, it will stuck. It means if you do other operation(e.g. type the wrong name then click “resolve” button, then search in the phone book) and
    repeat the operation above, it won’t stuck.
    It is appreciate that you can submit a feedback to Microsoft:
    https://connect.microsoft.com/
    Thanks,
    Dean Wang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • When I try and open Microsoft Word 2011 documents they start opening one after another at a rapid speed and I can't stop it. I reboot and same thing happens?

    When I try and open Microsoft Word 2011 documents on my  IMAC they start opening one after another at a rapid speed and I can't stop it. I reboot and same thing happens. The documents open in rapid succession on their own and don't stop until I force close or after maybe 100 or more open I start getting the following message for each document attemting to open "This document could not be registered. It will not be possible to create links from other documents to this document" and then in paretheses the name of the document. After I click okay another trys to open. Any suggestions?

    If you had multiple documents open and quit the app without closing all of the docs first, it will open them again when you launch the app. Open Word, and then close all the documents, you may be asked to save the document, if the document was already saved but you made changes to it before you quit the app, you may need to save the changes first, shorcut ( command and s keys). After you close all of the documents then quit the app and restart the computer. See if this works.

  • Printing microsoft word 2003 document and pdf created from the document are different

    I created a microsoft word 2003 document with jpg pictures and printed it on my HP Inkjet printer. I then created a pdf by saving as a pdf from the microsoft word 2003 document. The settings for images were 300 dpi and zip compression. The pdf file created was ~3 MB whereas the word document was ~250 KB. It looked fine on the screen but when I printed it the jpg pictures from the pdf were very dark and not very desirable. When I printed it on my HP Color laser 2600n printer I couldn't see the difference in the jpg pictures.
    I am creating the pdf files to send to the online publisher lulu.com to print. I have used the settings to create the pdf they recommend from their website; however they aren't real clear in the information they give for the recommended settings.
    My question is why would the print out be so awful using the HP Color Ink Jet printer since it is very good for printing pictures?

    There are many reasons, but most revolve around the color space and coding for the colors. Acrobat uses 8 bit RGB.

  • How do I open a microsoft Word 95 document in Pages?

    How can I open a Microsoft Word 95 document in Pages?

    The document format is too old. Download the free LibreOffice, and then open this Word '95 document with it. Then export to a different filename.doc, or filename.docx, and then open in Pages.

  • How to Enforce Sharepoint 2013 content type validation rules when modifying document using Word 2013

    Good day,
    I have two date columns (Start Date and End Date) in a content type in Sharepoint 2013.  A file library uses this content type.
    In the document template I have the two dates (Start Date and End Date) showing in the Document Panel.  I can edit them well enough and they show in the document correctly.
    In the content type I have validation rules that the End Date must be greater than the Start Date. 
    The question is, how can I enforce this validation on the client side in Word.  Is there anyway to achieve this?
    The user will not have access to change the document properties in Sharepoint. (Not my call)
    Thank-you!

    The "panel" is called the Document Information Panel in SharePoint. You can customize this using InfoPath from the page where you created / edited your Content Type. Go to Settings, Site Settings Content Types, edit your content type, click Document
    Information Panel and then click "Edit this template". In InfoPath you can create a Rule to enforce your dates.
    This may require the Enterprise Edition of SharePoint to support the InfoPath Forms Services.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Unable to edit document template in SharePoint 2013

    We have uploaded a set of templates that users can select from the drop down list in the Document field in the Document Library.  We now need to edit one of these document templates.
    We follow the procedure and make the edits which changes the template but when we then select that template from the drop down list, the edits have not been actioned.
    Can anyone please assist?

    Hi,
    As I understand, The modification was not saved back to the template.
    How do you edit the document template? 
    Check if the URL of the template is right. You can go to the site setting->site content type->click the content type you want to edit->advanced setting->edit the template->open the template, and click file->to check if the URL under the template is right.
    As a workaround, when you edit the template you can save the template in the local computer, and you can upload the template you have saved in the advanced setting for the content type.
    The article below is about how to create Document Templates for Document Libraries in SharePoint 2010, it also can work in SharePoint 2013.
    http://blog.henryong.com/2007/02/12/how-to-create-document-templates-for-document-libraries/ 
    Best regards,
    Sara Fan
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Getting correlation error while opening document library in SharePoint 2010

    Hi,
    I installed SQL Server 2008 R2 SP1 and SharePoint 2010 on Windows Server 2008 R2. Everything went fine for first days. Now I am getting error while opening any of the document libraries. However lists are opening fine.
    Error:
    An unexpected error has occured.
    Troubleshoot issues with Microsoft SharePoint Foundation
    Correlation ID: fa54267f-4436-8298-c7698977728c
    I checked the logs, I showing some error with the line http://Microsoft.Office.Server.UserProfiles/GetProfileProperties
    Please let me know if you have any idea about this error or let me know if you need further inputs from me. Thanks.

    Hi Tarique,
    Whether you have granted the user proper permissions on this site. You should make sure the user has permissions on the site.
    In addition, there are some reasons for the log-in issue, please take a look at:
    http://sharepointsolutions.blogspot.com/2008/06/how-do-i-make-our-sharepoint-site-stop.html
    http://sharepointsolutions.blogspot.com/2008/06/how-do-i-make-our-sharepoint-site-stop_17.html
    http://dinesql.blogspot.com/2011/01/cannot-login-to-sharepoint-2010-site.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How do I add new fonts I've downloaded to Microsoft Word? It's in my font book but not usable on MW., How do I add new fonts I've downloaded to Microsoft Word? It's in my font book but not usable on MW.

    How do I add new fonts I've downloaded to Microsoft Word? It's in my font book but not usable on MW.,

    Typical issue with Font Book.
    Restart your Mac and immediately hold down the Shift key when you hear the startup chime to boot into Safe Mode. Keep holding the Shift key until you see a progress bar towards the bottom of the screen. You can let go of the Shift key at that point.
    OS X asks you to log in (you will get this screen on a Safe Mode boot even if your Mac is set to automatically log in). Let the Mac finish booting to the desktop and then restart normally. This will clear Font Book's database and the cache files of the user account you logged into in Safe Mode.

  • Accidentally copied microsoft word icon  to desk top.   Now program will not work. Error message says cannot be opened because of problem. How do I re-install ?

    Accidentally copied microsoft word icon  to desk top.   Now program will not work. Error message says cannot be opened because of problem. How do I re-install ?

    Drag the Word icon back to where it belongs.
    Applications > Microsoft Office 2011 > Put Word there.
    I'm assuming you have Office 2011. If you have 2008 there should be a similar location to put Word.

  • Managed metadata columns in document information panel with multiple content types

    Hi everyone,
    The problem I have is that for custom content types not all managed metadata columns are displayed in Document Information Panel (DIP) for the document in the Office client application. 
    However, everything works fine with 1 specific content type. Even though the others using exactly the same site columns. The content types are deployed using visual studio to the content type hub, and after this the content types are correctly published to
    the site collections, there are no publish issues here. 
    When I create a document based on the second content type in the same library, all fields are showed in the document information panel, except the managed metadata columns.
    Detailed explanation:
    Library: procedures
    Content types:
    - simple procedure (with 4 managed metadata fields and some other text fields)
    - procedure with approval (with the same 4 managed metadata fields and some other text fields)
    Scenario 1: I add the 'simple procedure' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 2: I add the 'procedure with approval' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 3: I add the 'simple procedure' and 'procedure with approval' content types to the document library procedures (added simple procedure first). When I create a new document based on the 'simple procedure'
    content type, everything works fine and he shows all metadata fields. When I add a new document based on the 'procedure with approval' content type, the document information panel shows correctly, except all managed metadata fields. These are not visible at
    all. Though they worked perfectly in scenario 1 and 2.
    Is this a known issue or is there a workaround for this? 
    Thanks in advance! 
    Kind regards, Davy

    Yes!
    This problem is solved right now.
    My issue was that I'm using custom content types deployed by Visual Studio in the content type hub. To create a managed metadata site column in visual studio, you need to have first of all your managed metadata field, but also a hidden field accompagnied
    to make the actual mapping like the example below:
    <Field ID="{B654D984-187A-471B-8738-F08F3356CFDA}"
    Type="TaxonomyFieldType"
    DisplayName="Countries"
    ShowField="Term1033"
    EnforceUniqueValues="FALSE"
    Group="Demo"
    StaticName="Countries"
    Name="Countries">
    <Customization>
    <ArrayOfProperty>
    <Property>
    <Name>TextField</Name>;
    <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{67308AC2-9556-456B-BF9E-43E8F23EBEE6}</Value>
    </Property>
    </ArrayOfProperty>
    </Customization>
    </Field>
    <Field Type="Note"
    DisplayName="Countries_0"
    StaticName="CountriesTaxHTField0"
    Name="CountriesTaxHTField0"
    ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}"
    ShowInViewForms="FALSE"
    Required="FALSE"
    Hidden="TRUE"
    CanToggleHidden="TRUE"
    Group="Demo"
    RowOrdinal="0"
    />
    </Elements>
    VERY important here is that when you create your content type using visual studio, you not only have to add the managed metadata site column in your xml (which let the content type work already perfectly) but also add the hidden field to your content type
    xml !! This way, SharePoint knows that when you have multiple content types with the same site columns in the same library, the second content type also need to get the hidden field from this site columns like in the example below!
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Document (0x0101) -->;
    <ContentType ID="0x010100571ebc0f478a49d5a775039347ee1535"
    Name="Document Location"
    Group="Demo"
    Description="A content type containing Managed Metadata Column."
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{B654D984-187A-471B-8738-F08F3356CFDA}" Name="Countries"/>
    <FieldRef ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}" Name="CountriesTaxHTField0"/>
    <FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" Name="TaxCatchAll"/>
    <FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" Name="TaxCatchAllLabel"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    I'm very happy I found this solution, because in the whole project i'm implementing, this was used a lot!
    Special thanks to the blog of @cann0nf0dder (http://cann0nf0dder.wordpress.com/2013/04/01/creating-a-site-column-with-managed-metadata) which let me think about this! 
    This ticket is answered now! :-)
    Kind regards,
    Davy

  • How to read excel file in document library and store excel content in sql table

    Hello,
    Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
    Please let me know the ways to acheive this. Feel free to give your suggestions.
    Thanks,
    Cool Developer

    Hi!
    this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
    System.Data.OleDb.
    OleDbConnection ExcelConnection = null;
    FileMode fileMode;
    string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
    using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
    using (SPWeb _web = _site.OpenWeb())
    string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
    SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
    fileMode =
    FileMode.Create;
    byte[] byteArray = _file.OpenBinary();
    MemoryStream dataStream = new MemoryStream(byteArray);
    Stream stream = dataStream;
    using (FileStream fs = File.Open(filePath, fileMode))
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
    fs.Write(buffer, 0, bytesRead);
    fs.Close();
    //Create the Connection String
    try
    string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source ='"
    + filePath + "'; Extended Properties=Excel 5.0";
    //Create the connection
    ExcelConnection =
    new System.Data.OleDb.OleDbConnection(ConnectionString);
    //create a string for the query
    string ExcelQuery;
    //Sheet1 is the sheet name
    //create the query:
    //read columns from the Excel file
    ExcelQuery =
    "Select * from [Sheet1$]"; // from Sheet1";
    //use "Select * ... " to select the entire sheet
    //create the command
    System.Data.OleDb.
    OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
    //Open the connection
    ExcelConnection.Open();
    //Create a reader
    System.Data.OleDb.
    OleDbDataReader ExcelReader;
    ExcelReader = ExcelCommand.ExecuteReader();
    //For each row after the first
    while (ExcelReader.Read())
    thanks,
    kshitij

  • Hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem

    hyper link of public image(hyperlink or image) can not be saved on windows server 2012 and sharepoint 2010 problem, is this a bug?
    thanks for any reply.
    Rosone

    It is not a bug, you might be using IE in Windows server 2012 and and browser might be restricting your site actions to respond properly.
    Check this in a different browser or access site in a differ OS.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

Maybe you are looking for

  • Open file Dialog!!!

    Hello folks, In my program I am using the FM TMP_GUI_FILE_OPEN_DIALOG for opening a file. My additional requirement is I want to add some types to FILE TYPE LIST BOX on the dialog. For example...when we try to open a file on windows...we get a dialog

  • Process chain colour: active/scheduled?

    Hi there, Can i see from just looking at a process chain in RSPC whether or not it is scheduled and active? Hope you can help Cheers Neil

  • SQLPlus truncates output of sdo_geometry.get_wkt()

    Hi, I'm trying to SELECT some geometries into a text file in WKT form. Here's my query: SQL> SPOOL test.txt SQL> set heading off SQL> SELECT bpa.geom.get_wkt() AS wkt FROM sometable bpa WHERE rownum < 20; POLYGON ((4447140.53 5524045.28, 4447140.23 5

  • Tlanes not being created for all locations for one product

    Hello Experts - I need some advice on the following situation: We have a set of products where tlanes are only being created for 3 locations out of many.  What would cause the tlanes to not be generated for all locations if all master data elements a

  • Authorization group in Z-Table and user assignment

    Hello, I have created Z table which stores sensitive data and have created maintenance view. I want particular users only to have change access to this table through SM30 and for that I have created my own autorization group. Now my question is: How