View Single Post
 
Old 04-05-2021, 09:33 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
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

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