|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to use Document Properties from Sharepoint in Conditional IF Statements?
My question and objective are very similar to the question at this link, but unfortunately the answer didn't provide enough information for me to implement the proposed solution: How to use Document Properties from Sharepoint in MS Word Field Codes? - SharePoint Stack Exchange
In SharePoint, I have a custom document Content Type that has custom columns / properties, which are passed to the new Word document from it. Based on those properties, I want the template to 'autofill' text (auto-insert an auto-text). So an example of the logic would be: If sharePointPropertyGender=female, insert paragraph1 I thought I could use the IF statement in MS Word's QuickParts and use DocProperty fields like so: { IF { DOCPROPERTY Gender } = "Female" {AUTOTEXT customText} "OTHER TEXT" } I tested and this seems to work fine with normal DocProperties in MS Word. Unfortunately, as is well documented (SharePoint Online/2016 - Document Properties vs DocProperty), SharePoint custom properties aren't related to DocProperties. So the "Gender" property from SharePoint isn't accessible as a DocProperty: Does anyone have any ideas how to make this work? I have also used VBA before, and I am open to using it if necessary. However, I had wanted to avoid it so end-users run into trouble with macro-disabled files (employees in my organization don't always remember to enable macros and then tell me the templates don't work!). Thank you in advance! (and apologies for the oversized screenshots) |
Tags |
properties, quick-parts, sharepoint |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional checkbox mailmerge: coding "or" statements within IF statements | mtracy16 | Mail Merge | 3 | 05-22-2018 02:03 PM |
legacy form fields conditional statements | steelcity79 | Word | 3 | 05-05-2018 04:02 AM |
saving conditional statements | notalec | Mail Merge | 7 | 10-16-2017 09:34 PM |
I know nothing about mail merge, but need help with conditional statements | briyosa | Word | 1 | 03-27-2017 10:17 PM |
Standard and SharePoint Library Properties | Kyron35 | Word | 0 | 02-20-2013 10:27 AM |