Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2020, 11:05 AM
Holden87 Holden87 is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Novice
DisplayBarCode with Custom field code
 
Join Date: Oct 2020
Posts: 5
Holden87 is on a distinguished road
Default 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?
Reply With Quote
  #2  
Old 10-02-2020, 01:18 PM
Charles Kenyon Charles Kenyon is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,124
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
  #3  
Old 10-02-2020, 01:32 PM
Holden87 Holden87 is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Novice
DisplayBarCode with Custom field code
 
Join Date: Oct 2020
Posts: 5
Holden87 is on a distinguished road
Default

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?
Reply With Quote
  #4  
Old 10-02-2020, 01:37 PM
Holden87 Holden87 is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Novice
DisplayBarCode with Custom field code
 
Join Date: Oct 2020
Posts: 5
Holden87 is on a distinguished road
Default

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?
Reply With Quote
  #5  
Old 10-02-2020, 04:37 PM
Charles Kenyon Charles Kenyon is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,124
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

"After download" confuses me.


What you need is:
{ DISPLAYBARCODE "{ DocProperty ITEM_ID_P }, { DocProperty DESCRIPTION_OF_DEFECT_P }" QR \q H \s 30 }
Reply With Quote
  #6  
Old 10-03-2020, 07:13 PM
Holden87 Holden87 is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Novice
DisplayBarCode with Custom field code
 
Join Date: Oct 2020
Posts: 5
Holden87 is on a distinguished road
Default

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
Reply With Quote
  #7  
Old 10-03-2020, 08:41 PM
gmayor's Avatar
gmayor gmayor is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #8  
Old 10-04-2020, 11:46 AM
Charles Kenyon Charles Kenyon is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,124
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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:
  1. A button on the Insert Menu.
  2. A building blocks gallery, the contents of which will appear on that menu and get in the way of other controls there.
  3. AutoText is included on that menu. It is now one type of Building Block.
  4. The Building Block Organizer is included on that menu and gives control over "quick parts" as well as other building blocks.
  5. Mislabelled Document Property Content Controls are on that menu. These include only a small subset of Document Properties and they are Mapped to the XML. They are very useful but never include custom document properties. Repeating Data Using Document Properties Content Controls and Other Mapped Content Controls
  6. Fields are listed on the menu because MS couldn't find another place to put them. (They could have simply put another button on the Insert tab.) They have nothing to do with the rest of "quick parts." There are the AutoText, and DocProperty fields which do access those quick parts.
Sorry for the rant. As you can see, I do not work for Microsoft.
Reply With Quote
  #9  
Old 10-07-2020, 02:02 PM
Holden87 Holden87 is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Novice
DisplayBarCode with Custom field code
 
Join Date: Oct 2020
Posts: 5
Holden87 is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 10-07-2020, 02:30 PM
Charles Kenyon Charles Kenyon is offline DisplayBarCode with Custom field code Windows 10 DisplayBarCode with Custom field code Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,124
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
Reply

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
DisplayBarCode with Custom field code 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
DisplayBarCode with Custom field code 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:14 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