다음을 통해 공유


Custom Word Template for Document Library Containing List Fields


Description

If our Organisation wants SharePoint list items in the word, Excel, PowerPoint document . Then we can achieve this task using the predefined template.
Predefined template is nothing but the list which is mapped with word document in this case.

http://4.bp.blogspot.com/-dCFmOgSRqaU/UYJCTZW4x1I/AAAAAAAAAOk/HB19bdK1GIc/s400/tem.png

Steps to achieve

Create a document Library in SharePoint 2010

  1. Now we need to add the column in the document library Title, Publish Date, Company E-mail
  2. Now the purpose of adding column in document library is to add the list column value.

Now create a word document so that we can use it as a template

Open a word document , design it as per your need . Now for example in the figure above We have mapped those three field. For that 

  1. Select Insert from the ribbon of word document.
  2. Go to quick parts> document properties
  3. Select the fields (here you can see the field which you have added in the document library in the previous step)

Now go to document library and "open with explorer" Here you will get Forms save your word template in it.

Note:- Forms will be hidden field

  1. Go to document Library > Library > Library Settings >Advanced settings > Template Url 
  2. Change it to CustomTemplate.docx 
  3. Make sure it should be .docx extension

 http://1.bp.blogspot.com/-7YCoXR9vet8/UYJJUvB6WvI/AAAAAAAAAO0/ES2g3mFQHP8/s400/tem1.png

Create a list(EmployeeList) with same column which you have added in document library.

  • Title,
  • Publish Date, 
  • Company E-mail

Now we need to write a workflow so that when data is entered in List , it will create a word template in document library.

Workflow

  1. Open the site in SharePoint Designer.
  2. From Left hand side select list workflow, select your list(here EmployeeList)
  3. Enter workflow name and description

http://2.bp.blogspot.com/-rLiiFBjZZk8/UYJKyOtN6yI/AAAAAAAAAPA/dwYu9EvHPeA/s320/tem1.png

 4. Then Edit the workflow > Go to Action > select Create List item 

http://4.bp.blogspot.com/-8Cvl8N2qd5E/UYJL6b2TSoI/AAAAAAAAAPU/ABf5Me3LrYs/s400/tem1.png

  5. In the above fig click on this list and select your "document Library " name.

http://4.bp.blogspot.com/-PrsBWULxfVE/UYJMhncmoTI/AAAAAAAAAPc/LYu-AWrNn_I/s400/tem1.png

 6. Now add all the three field here which we have created in the previous step

 7. Use fx to map the fields

 8. Now Save and publish the Workflow.

 9. Go to that list and add some items, (start the workflow from the ribbon)

 Finally you can see a document being created in the document library using the template which we have designed.