Before 2 days ago I don't even think I had looked at a visual basic script before. So, please bear with me. I'm a complete novice...but I do have a background in php scripting...so I'm not a total moron when it comes to this sort of thing.
Here's what I'm trying to do:
I want to build a script to insert images, inline, within Word and Outlook. This code is going to be primarily used to give emoticons back to the people in my office since we just switched from Eudora to Outlook and there are none. I've written code that works...but, it's alot of repetitious crap that I know can be simplified a LOT. Here's an example:
Sub EmotLargeAngry()
Selection.InlineShapes.AddPicture FileName:= _
"\\Server\IT Files\Macros\Emoticons\Images\Large\Angry.png", _
LinkToFile:=False, SaveWithDocument:=True
End Sub
I have that chunk of code 24 times for small, medium and large icons. I know I'm bound to be able to do some if statements in conjunction with a function that can squeeze this down to at least 1/3 if not less code. I'm just not familiar enough with VB to figure it out.
I need to be able to make individual buttons for each icon in a toolbar. So, somehow I'll need to be able to tell the script which button I pressed if the script were condensed to one function with if statements.
2 other little issues I'm having with this way of doing things...
1. I can only get this to work when Word 2003 is the email editor for Outlook. Some people in our office have Outlook 2003 and Word 2002, so Word is not an option for email editing in their case. How can I get this to work for Outlook independently?
2. When I insert the images in Outlook, they seem fuzzy as though they're being inserted large than their native size. How do I specify an image size in the script?
Thanks!!!
Matt Tyree
Here's what I'm trying to do:
I want to build a script to insert images, inline, within Word and Outlook. This code is going to be primarily used to give emoticons back to the people in my office since we just switched from Eudora to Outlook and there are none. I've written code that works...but, it's alot of repetitious crap that I know can be simplified a LOT. Here's an example:
Sub EmotLargeAngry()
Selection.InlineShapes.AddPicture FileName:= _
"\\Server\IT Files\Macros\Emoticons\Images\Large\Angry.png", _
LinkToFile:=False, SaveWithDocument:=True
End Sub
I have that chunk of code 24 times for small, medium and large icons. I know I'm bound to be able to do some if statements in conjunction with a function that can squeeze this down to at least 1/3 if not less code. I'm just not familiar enough with VB to figure it out.
I need to be able to make individual buttons for each icon in a toolbar. So, somehow I'll need to be able to tell the script which button I pressed if the script were condensed to one function with if statements.
2 other little issues I'm having with this way of doing things...
1. I can only get this to work when Word 2003 is the email editor for Outlook. Some people in our office have Outlook 2003 and Word 2002, so Word is not an option for email editing in their case. How can I get this to work for Outlook independently?
2. When I insert the images in Outlook, they seem fuzzy as though they're being inserted large than their native size. How do I specify an image size in the script?
Thanks!!!
Matt Tyree