#1
|
|||
|
|||
If Fields and custom properties testing values with spaces
I have a problem with IF testing custom properties with spaces in the values. in a field BILLING I have values like.
00 Admin 00 Accounting These cannot be changed they are generated by an external system. No macros can be used in startup either security paranoia and getting that approved. so in the document they want it to put Finance or Accounting and drop the 00. So I assumed an if test would help. {IF {DOCPROPERTY BILLING} = "00 Admin" "Administration" {IF {DOCPROPERTY BILLING} = "00 Accounting" "Accounting" ""}} However the string comparison of the fields always stops at the space in the Custom property. So 00 Admin in the custom property will even match 00UtterRubbish in the if test. has anyone any ideas how to get round this or do this another way using only fields without changing the Custom field content? Note I would even settle for just chopping of the 00 in the output unfortunately fields do not support mid$. Thanks Adrian. |
#2
|
|||
|
|||
Interestingly in Office 2016 reversing either side of the if test seems to work i.e IF "00 Admin" = {DOCPROPERTY BILLING}
However this has to work under 2010, nightmare I know. |
#3
|
||||
|
||||
Try:
{IF "{DOCPROPERTY BILLING}" = "00 Admin" "Administration"} {IF "{DOCPROPERTY BILLING}" = "00 Accounting" "Accounting"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Quotes did the trick, thank you
|
Tags |
if fields, properties |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Powerpoint Custom Properties | chopradeepti | PowerPoint | 1 | 01-15-2020 01:05 AM |
Add custom doc properties in "Doc properties control" | eazysnatch | Word | 2 | 09-13-2017 08:08 PM |
Testing multiple values of two independant variables and charting results | sgcannon | Excel | 0 | 10-20-2015 10:10 AM |
Custom Properties | b-baker | Word | 1 | 03-01-2012 01:15 AM |
Looping though Custom Properties in VBA | suekay | Misc | 0 | 05-19-2006 06:10 AM |