Can't run macro Outlook 2007 that was created in Word 2007

  • Thread starter Thread starter jjobin
  • Start date Start date
J

jjobin

I have created the following macro in Word 2007. It is designed to take a
number and convert it to a barcode. (note that you have the barcode font
installed for the barcode to appear). If you select a number (highlight) then
run the macro, it will produce the barcode directly under the number.

It works perfect in Word 2007 but I'm wanting it to function in Outlook
2007. The macro does not even appear in the Developer-Macro-Macro Name
section.
I can cut and paste the code into Outlook 2007, VBA, but when I run it I get
an error on the first line of code.
Sub Convert2BarCode()
'
' Convert2BarCode Macro
'
'
Selection.Copy
Selection.Copy
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="*"
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:="*"
Selection.MoveLeft Unit:=wdCharacter, Count:=17, Extend:=wdExtend
Selection.Font.Name = "SKANDATA C39"
Selection.Font.Size = 24
End Sub
 
Back
Top