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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top