Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Outlook 2010 Macro: add info to Company task field

Posted on 2014-10-19
3
Medium Priority
?
168 Views
Last Modified: 2014-10-22
Dear expert,

Be able to highlight/select several tasks and have an input cell pop up for Company field and in next step this Company field replaces all the info which may have existed in the Company field of the selected tasks.

Br,
JP
0
Comment
Question by:easycapital
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 1000 total points
ID: 40391604
Hi,

pls try
sub Macro()
strCompany = InputBox("New Company", "Select the new Company name")
For Each itmTsk In Application.ActiveExplorer.Selection.Items  
    itmTask.Company = strCompany
Next
End Sub

Open in new window

Regards
0
 
LVL 20

Accepted Solution

by:
ltlbearand3 earned 1000 total points
ID: 40393513
I don't know about the objects in older versions of outlook as I don't have a copy to test, but here are some adaptations to Rgonzo's code that will work in Office 2010 and newer.

Sub UpdateCompany()
    Dim strCompany As String
    Dim objTask As Outlook.TaskItem
    Dim i As Integer

    strCompany = InputBox("New Company", "Select the new Company name")

    For i = 1 To Outlook.ActiveExplorer.Selection.Count
        Set objTask = Outlook.ActiveExplorer.Selection.Item(i)
        objTask.Companies = strCompany
        objTask.Save
    Next
    
    MsgBox Outlook.ActiveExplorer.Selection.Count & " task(s) have been update to a new company of " & strCompany
    
End Sub
       

Open in new window

0
 

Author Closing Comment

by:easycapital
ID: 40398622
Excellent!

I went with 2nd solution.

Br,
Juan
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Changing a few Outlook Options can help keep you organized!
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question