View Single Post
 
Old 06-11-2020, 03:53 AM
SparkoUK SparkoUK is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2020
Posts: 3
SparkoUK is on a distinguished road
Angry 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.
Reply With Quote