#1
|
|||
|
|||
DisplayBarCode with Custom field code
Hello MMOF Community,
I have been attempting to use the DisplayBarCode feature in word with success, but am having difficulty attempting to use this with Custom Field Codes (Doc Property Field) to pull information into the QR code. I am using this with information generated from our QMS system and know the connection for the custom field is working as the correct information is being displayed in other areas of the document. I have the following code written: { DISPLAYBARCODE "{ ITEM_ID_P }, { DESCRIPTION_OF_DEFECT_P }" QR \q H \s 30 } Any {} brackets have been created with the Ctrl + F9 hot key and ITEM_ID_P and DESCRIPTION_OF_DEFECT_P are custom field codes which were added through the quick parts menu correctly. Does DISPLAYBARCODE not work with custom field codes or am I doing something slightly wrong? |
#2
|
|||
|
|||
As far as I know, your "custom field codes" are cross-references to bookmarks, the equivalent of Ref fields.
You could set document variables or document properties and use those with DocProperty and DocVariable fields. |
#3
|
|||
|
|||
Thanks for the response Charles! These are document property fields (Setup through Advanced Properties --> Custom) in the document. It sounds like the DocProperty is acceptable to use in DISPLAYBARCODE, perhaps I dont have my syntax correct or I need to set up another parameter or call to get this to work correctly?
|
#4
|
|||
|
|||
Let me add a little clarification, when I use the formula above, the fields are "disappearing" from the form after downloaded. It shows
{ DISPLAYBARCODE "," QR \q H \s 30 } It's almost as if the fields where removed since they are embedded in another empty field string. Does that explanation make sense? |
#5
|
|||
|
|||
"After download" confuses me.
What you need is: { DISPLAYBARCODE "{ DocProperty ITEM_ID_P }, { DocProperty DESCRIPTION_OF_DEFECT_P }" QR \q H \s 30 } |
#6
|
|||
|
|||
Hello Charles,
The word doc is a "Office Integrated" document. What we do is create custom fields (docProperty) with the name and value (type text) equaling a field name in our QMS system. When in our QMS system, it will use this word doc and it generates a new word doc that has the values now for the given custom field names when a field in our QMS system matches. It appears I can generate a QR code correctly after the document has been created and the fields are updated, but I cannot set this up as a template before hand as the quick part is missing from the string (i believe it goes missing when the value of the custom field is updated). Does that make any sense? Sorry if I am unable to explain this correctly |
#7
|
||||
|
||||
Obviously the bar code will not display if the values don't yet exist in the document, but you can still create the field structure. You just have to update the fields after the values have been applied.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#8
|
|||
|
|||
See Graham's comment.
Rant warning! In my opinion, the term "quick part" is an abomination and whoever at MS came up with it should be fired. It is a recipe for confusion. Custom Document Properties are not "quick parts." "Quick Part" is:
|
#9
|
|||
|
|||
I understand that if the value "doesn't yet exist", its not going to show. The docProperty Name and Value show as the same (field name from QMS system such as Rev_P) and when we select the office integrated template in an event, it will replace the value for the given field name with the stored field for the given event (Rev D). Doing a little research and testing, it appears that the string for the docProperty is not updating and instead still shows as "Rev_P" or whatever given field I am entering. When I click "Update field codes", I get an error "Error! Unknown document property name". Maybe this will give a little more information into my conundrum.
|
#10
|
|||
|
|||
It sounds like what is showing "Rev_P" is not a field but text. When you have nested fields, the F9 key does update them all.
|
Tags |
custom fields, displaybarcode, qr code |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I implement my custom function in my VBA code? | Bumba | Excel Programming | 4 | 12-22-2019 06:04 PM |
VBA Code to search for field codes with certain text before the Field code and to change style | welcometocandyland | Word VBA | 4 | 02-08-2017 06:53 PM |
Code to creating a custom TOC including too many styles | amer1749 | Word VBA | 4 | 07-03-2016 10:42 AM |
Custom Field help | sagenth | Outlook | 0 | 09-05-2014 09:12 AM |
Custom table of contents referencing a custom field | skaboy607 | Word | 3 | 01-16-2014 06:59 AM |