23-09-24 01:19 AM - edited 23-09-24 01:20 AM
I am writing an automation that will produce a Word document that I'll save as a PDF and email it. I need to print the employee id as a Code 128 bar code. Has anyone done this? I saw where you can use CTRL+F9 and use the command "DisplayBarcode" inside the word document but that mean I would have spy the actual word document and send the characters to the table entry I have set up for the Employee ID. Then I would have to "right" click and click "Toggle Codes" to get it to convert. Lot of work just to get a bar code to appear on the document.
Anyone got a better way or clue me in on something I'm not thinking about.
All suggestions appreciated.
23-09-24 08:11 AM
Hi, rhester,
do you know that there is a VBO MS Word where you can do all this programmatically? If you have some basic knowledge of programming you can record macro in MS Word to see how the conversion is done and then transformed it into code stage in VBO. If you need more help let me know.
Regards
Zdenek
23-09-24 09:28 PM
I tried what you said and recorded a macro; however, when I try to right click on the {DisplayBarcord 12345 CODE128 \t} field code it will not do anything while you are in record macro mode. I see to see what happens in the "toggle field code". Please if you can help me so more if available.
23-09-24 09:41 PM
26-09-24 12:59 AM
Here is what I did to get this going:
1. Using the word document that I called my template I went to the location in the document that I wanted the barcorde to appear and positioned the cursor there and hit CTRL F9. This created a field code with the automatic ().
2. Then I clicked in between the {} and inserted a bookmark there and gave it a name of "Barcode". I then hit ALT F9 to toggle the field codes....this leaves the field code but puts it in an execution type mode.
3. The above only has to be done 1 time when you are setting this up.
4. In my Blue Prism automation I created a stage of "Word VBO Extended\Update Bookmark" and gave it the parm the bookmark name of BARCODE and input parm to the command I coded the following: "DisplayBarcode " & [barcode] & " CODE128 \t". This caused it to insert this into the bookmarked field in the word document. Since I had already set the toggle field codes to an execution mode it makes it automatically display the barcode for me without having any other commands sent.