![]() |
|
#1
|
|||
|
|||
|
Hi;
I have numbers in outlook calendar items that I have to add an asterisk to the front and end of it for Barcode reading. The barcode reader uses the asterisks to tell it where to start and stop reading. If they are not there, it wont read it. So if the number was 123, it will become *123* When outlook sees the asterisks added, it automatically changes the font to bold. The Bold font changes the width of the vertical lines in the barcode and that screws up the interpretation of the line. So I really need to be able to add the asterisks without the font changing to Bold. Is there a way to disable this setting in outlook? Thanks for any help. |
|
#2
|
||||
|
||||
|
I don't think that is possible, but I gave you a macro a few days ago that would insert a barcode. If you don't want a QR code then change the line
Code:
oRng.Fields.Add oPara, 99, Chr(34) & sNum & Chr(34) & Chr(32) & "QR" & " \t", False Code:
oRng.Fields.Add oPara, 99, Chr(34) & sNum & Chr(34) & Chr(32) & "CODE39" & " \t", False
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#3
|
|||
|
|||
|
Thanks for your help.
Nothing happens when I run this macro. I selected the developer tab Then clicked Visual Basic (Alt f11) Selected Insert and inserted a new module Pasted the code in the new module Renamed the module to AddBarCode When I run it, nothing happens |
|
#4
|
||||
|
||||
|
Did you select the calendar item before running the code?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#5
|
|||
|
|||
|
yes...the button to run the macro is on the calendar item quick access toolbar
|
|
#6
|
||||
|
||||
|
In that case the appointment item content does not match your description of that content. The code was specific to what you said.
The best I can suggest without access to the item is to offer a macro that will bar code the selected text in the appointment body. Select the number you want coding and run the following. Code:
Sub BarCodeSelected()
'Graham Mayor - https://www.gmayor.com - Last updated - 06 Apr 2021
Dim olItem As AppointmentItem
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
Dim oPara As Object
Dim i As Integer
Dim sNum As String
Set olItem = Application.ActiveExplorer.Selection.Item(1)
With olItem
.Save
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Windows(1).Selection.Range
sNum = oRng.Text
oRng.Fields.Add oRng, 99, Chr(34) & sNum & Chr(34) & Chr(32) & "CODE39" & " \t", False
End With
lbl_Exit:
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change to Bold font behaviour in Word 2016? | jharrop | Word | 3 | 08-06-2018 05:31 PM |
Replace bold font with different bold font
|
BigJ | PowerPoint | 1 | 07-30-2018 08:06 AM |
| Disable Asian font in comments or choose Latin font by default | ryofurue | Word | 3 | 05-30-2018 08:33 PM |
| word 2007 bold not using font | crodgers | Word | 1 | 10-12-2011 04:42 AM |
| David.ttf font coming up bold | nazareneisrael | Word | 0 | 01-25-2010 11:07 AM |