• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 33
  • Last Modified:

Formula in Word

I need a formula that test the contents of the Tags field in Word.

Our firm has a line at the bottom of correspondence with reads
SPC:  via Certified Mail #1111 0000 0000 0000 0000 - Return Receipt Requested
or
SPC:  via Fedex Airbill #
or
SPC:  hand deliver or other language, but no numeric values.
or
the SPC line does not appear at all if the Tags field is blank.

Tags field in Properties will either have a number greater than 1000000000000000000 (Certified Mail)
greater than 100000000000 and less than 1000000000000000000 (Fedex)
or verbiage, if any, which should appear exactly as written
0
Bill Golden
Asked:
Bill Golden
  • 2
  • 2
1 Solution
 
GrahamSkanCommented:
Is the Tags field a custom document property?

What sort of formula are you looking for - a test using Word Fields, VBA or something else?
0
 
Bill GoldenExecutive Managing MemberAuthor Commented:
Tags is a standard field used by Word. It is in the Word properties section.

Previously, Word 2003, we used Word fields with an If Statement
0
 
Bill GoldenExecutive Managing MemberAuthor Commented:
Currently, I have the following formula...

IF TAGS<1000000000000000000 "Fedex Airbill # "Tags"" "Certified Mail #"Tags" - Return Receipt Requested" \* MERGEFORMAT

I do not understand the nomenclature involved to get the value of Tags to print and my IF statement is not working.
0
 
GrahamSkanCommented:
Tags in that sense are data external to the Word document file., so copying the document doesn't copy the Tags.  They are seen in the document properties 'Keywords, so you would need to use the DOCPROPERTY field. The next condition would be nested in the False part of the previous condition.
{ IF {DOCPROPERTY Keywords} <  1000000000000000000 "Fedex Airbill # " { IF {DOCPROPERTY Keywords} >  100000000000 "Certified Mail" "...}}
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now