Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2020, 07:51 AM
joelg joelg is offline How to use Document Properties from Sharepoint in Conditional IF Statements? Windows 10 How to use Document Properties from Sharepoint in Conditional IF Statements? Office 2019
Novice
How to use Document Properties from Sharepoint in Conditional IF Statements?
 
Join Date: Nov 2020
Posts: 1
joelg is on a distinguished road
Default 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)
Reply With Quote
Reply

Tags
properties, quick-parts, sharepoint

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Document Properties from Sharepoint in Conditional IF Statements? Conditional checkbox mailmerge: coding "or" statements within IF statements mtracy16 Mail Merge 3 05-22-2018 02:03 PM
How to use Document Properties from Sharepoint in Conditional IF Statements? legacy form fields conditional statements steelcity79 Word 3 05-05-2018 04:02 AM
How to use Document Properties from Sharepoint in Conditional IF Statements? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft