![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I'm a recent migrant from Thunderbird (company imposed)
After opening up a contact window, I want a simple keystroke (like ctrl-m) to send mail to that contact. It looks like my only options now are alt-a-m (alt, actions, mail) or moving my hand to the mouse to click on the new message button. I thought I could record a macro and assign it to a keystroke but it appears that Outlook does not have a Macro record function. Any suggestions? TIA, Mark |
Ads |
#2
|
|||
|
|||
![]()
Click on tools, macor, and then Visual Basic Editor
Create a new Module. You can keep the default name of Module1, but I recommed you change it. Do not name the module the same name as the sub. Post the following code to your macro. Sub Sendmailthiscontact() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portion of macro was created to obtain the email address from the open contact ' If you do not have an opend contact, the macro will fail. ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem If myItem.Email1Address "" Then strContactInfo = myItem.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Set myItem2 = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem2.Recipients.Add(strContactInfo) myItem2.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set myItem2 = Nothing End Sub |
#3
|
|||
|
|||
![]()
Darren, thanks so much for saving me from coming up the vba learning
curve... Mark "Darren" wrote in message ups.com... Click on tools, macor, and then Visual Basic Editor Create a new Module. You can keep the default name of Module1, but I recommed you change it. Do not name the module the same name as the sub. Post the following code to your macro. Sub Sendmailthiscontact() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portion of macro was created to obtain the email address from the open contact ' If you do not have an opend contact, the macro will fail. ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem If myItem.Email1Address "" Then strContactInfo = myItem.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Set myItem2 = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem2.Recipients.Add(strContactInfo) myItem2.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set myItem2 = Nothing End Sub |
#4
|
|||
|
|||
![]()
But it gets more complicated,
After getting the macro to work, I get a message that says a program is trying to access "your email addresse" allow for then I'm given a combo box 1 min, 2 min, 3 min etc... requiring more keystrokes... argggh Mark "Darren" wrote in message ups.com... Click on tools, macor, and then Visual Basic Editor Create a new Module. You can keep the default name of Module1, but I recommed you change it. Do not name the module the same name as the sub. Post the following code to your macro. Sub Sendmailthiscontact() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portion of macro was created to obtain the email address from the open contact ' If you do not have an opend contact, the macro will fail. ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem If myItem.Email1Address "" Then strContactInfo = myItem.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Set myItem2 = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem2.Recipients.Add(strContactInfo) myItem2.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set myItem2 = Nothing End Sub |
#6
|
|||
|
|||
![]()
2003. No but I will now. Thanks,
Mark "Diane Poremsky [MVP]" wrote in message ... that's outlook's security. which version of outlook? have you checked outlookcode.com for methods to avoid the prompts? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook newsletter: "Mark" wrote in message ... But it gets more complicated, After getting the macro to work, I get a message that says a program is trying to access "your email addresse" allow for then I'm given a combo box 1 min, 2 min, 3 min etc... requiring more keystrokes... argggh Mark "Darren" wrote in message ups.com... Click on tools, macor, and then Visual Basic Editor Create a new Module. You can keep the default name of Module1, but I recommed you change it. Do not name the module the same name as the sub. Post the following code to your macro. Sub Sendmailthiscontact() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portion of macro was created to obtain the email address from the open contact ' If you do not have an opend contact, the macro will fail. ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem If myItem.Email1Address "" Then strContactInfo = myItem.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Set myItem2 = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem2.Recipients.Add(strContactInfo) myItem2.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set myItem2 = Nothing End Sub |
#7
|
|||
|
|||
![]()
Wow, way more complicated than I have time for...
Thanks for the pointer however. Mark "Mark" wrote in message ... 2003. No but I will now. Thanks, Mark "Diane Poremsky [MVP]" wrote in message ... that's outlook's security. which version of outlook? have you checked outlookcode.com for methods to avoid the prompts? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook newsletter: "Mark" wrote in message ... But it gets more complicated, After getting the macro to work, I get a message that says a program is trying to access "your email addresse" allow for then I'm given a combo box 1 min, 2 min, 3 min etc... requiring more keystrokes... argggh Mark "Darren" wrote in message ups.com... Click on tools, macor, and then Visual Basic Editor Create a new Module. You can keep the default name of Module1, but I recommed you change it. Do not name the module the same name as the sub. Post the following code to your macro. Sub Sendmailthiscontact() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portion of macro was created to obtain the email address from the open contact ' If you do not have an opend contact, the macro will fail. ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem If myItem.Email1Address "" Then strContactInfo = myItem.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Set myItem2 = myOlApp.CreateItem(olMailItem) Set myRecipient = myItem2.Recipients.Add(strContactInfo) myItem2.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set myItem2 = Nothing End Sub |
#8
|
|||
|
|||
![]()
Review the following code using Redemptino. In addition, creating your
own certificate. Sub Sendmailtest() ' This macro will send an email to an open contact On Error GoTo Endlable Dim ns As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Dim Item As Object Dim strContactInfo As String Dim dataObject As MSForms.dataObject ' ------------------------------------------------------------------ ' This portino of macro was created to obtain the email address from the open contact ' ------------------------------------------------------------------ Set objApp = CreateObject("Outlook.Application") Set objNS = objApp.GetNamespace("MAPI") Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector.CurrentItem ' Use redemption library to create safe mailitem Dim SafeContact, oContact Set SafeContact = CreateObject("Redemption.SafeContactItem") 'Create an instance of Redemption.SafeContactItem 'Set oContact = Application.Session.GetDefaultFolder(10).Items(1) 'Get a contact item from Outlook, can be any other contact SafeContact.Item = myItem 'set Item property of a SafeContact to an Outlook contact item 'SafeContact.Item = oContact 'set Item property of a SafeContact to an Outlook contact item If SafeContact.Email1Address "" Then strContactInfo = SafeContact.Email1Address 'access Email1Address property from SafeContact, no warnings are displayed 'MsgBox SafeContact.Email1Address End If ' ------------------------------------------------------------------ ' This portion of macro opens a new mail item ' ------------------------------------------------------------------ Dim SafeItem, oItem Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem Set oItem = Application.CreateItem(0) 'Create a new message SafeItem.Item = oItem 'set Item property SafeItem.Recipients.Add (strContactInfo) 'SafeItem.Body = "Test Body" SafeItem.Subject = "Test Subject" SafeItem.Display Endlable: Set myNameSpace = Nothing Set myFolder = Nothing Set myItem = Nothing Set SafeItem = Nothing Set SafeContact = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
sending mail | Sean Doyle | Outlook Express | 3 | October 6th 06 01:53 PM |
keystroke or shortcut to "finalizing" the entry of a calender even | calender help | Outlook - Calandaring | 0 | September 12th 06 07:53 PM |
O2k3: single keystroke to move a message(s) to a pre-determined folder(s). | Michael March | Outlook - General Queries | 1 | August 6th 06 08:44 PM |
sending mail | Monica Squires | Outlook - General Queries | 5 | May 7th 06 05:03 PM |
keeps sending same e-mail | Rie Rie | Outlook - General Queries | 3 | March 21st 06 08:14 PM |