Outlook 2007 Update Fields Thru Tasks

Status
Not open for further replies.
You repeated what you said above and I wrote back : I think so as in a contact, I have that script code that creates a task to that contact and the contact link is at the bottom of the task.

No, that second reply was the frinkin' board reposting my replies. :) I don't know what is wrong with it - it seems like its mostly me who is affected by it, although i think you and someone else had double posts yesterday.

I've been thinking about switching forum software and this might be enough to make me change... or drive me to drink. lol
 
I still need the help!!!!

My kids tell me that all the time, but usually not in a nice way. lol (Can you tell I just got off a 1 hr meeting that accomplished nothing? :))

I'm getting type mismatch when i test the code and i can't see where the problem is - it's not highlighting the code, so the error kicks in before it doesn't anything. I think the problem is with this For cq = 0 To UBound(conts) is sending data to outlook that is not what its expecting, but it should work so i don't understand the problem.
 
I have no idea - the code looks correct, so it should work. maybe check with the person who gave it to you and see if they have any ideas what could be wrong.
 
Any new thoughts so i can change the fields of contacts with tasks?
 
No. Test the macro with the default fields - this will tell you if it is working at all. If it works, then the problem is the custom fields. If not, it's the code.
 
What do you mean and how to:

Test the macro with the default fields
 
Instead of using the custom fields in the macro, use the default fields - like hte tash start field and try inserting it into the contact's body. This will help you determine if the macro is working. Another option is to write all of the values in the immediate window. Or write after each step

debug.print "step 1"

debug.print "step 2"

The code looks ok to me, and this will help you troubleshoot it.
 
As I repeat, I am not the expert in this area. Can you possibly just post the code I need to change and make the changes you just mentioned, and then I will run it and let you know the result of it. Thanks very much.
 
I'm not much of an expert all of the time either. :) It's really hard for me to test this since you are using custom fields and my outlook doesn't support the contact links that you are using.

The code looks good - I can't see any glaring errors in it, the logic looks good. It either can't be done or there is a mistake that is easy to overlook.

Instead of using this:

otask.UserProperties.Item("FieldName") = oContact.UserProperties.Item("FieldName")

Test it with regular fields:

otask.Subject = oContact.fullname

otask.body = oContact.subject & vbcrlf & otask.body

You could even add a few debug.prints to the code then check the immediate window and see if the field values print

debug.print ocontact.fullname
otask.Subject = "before " oContact.fullname
debug.print "after " otask.Subject
 
Here is the macro of the Module someone gave me....please show me exactly what is changed:

Public Sub UpdateContactFieldTasks(ByVal FieldName As String, ByVal myValue As String)

Dim tsk As taskItem, c As contactItem, f As MAPIFolder
Set f = Application.GetNamespace("mapi").GetDefaultFolder(olFolderContacts)
For Each tsk In ActiveExplorer.Selection
conts = Split(tsk.ContactNames, ",")
For cq = 0 To UBound(conts)
Set c = f.Items(conts(cq))
c.UserProperties.Item(FieldName).value = myValue
c.Save
Next
Next
End Sub
 
since myvalue is coming in from elsewhere, add a debug.print myvalue right before the For Each line.

add a debug.print tsk.ContactNames after the For Each line.

add debug.print conts after the conts = line

If these don't print the expected values in the immediate window, the problem is with a different macro.
 
I did the following and each added line shows up as an error yellow

Public Sub UpdateContactFieldTasks(ByVal FieldName As String, ByVal myValue As String)

Dim tsk As taskItem, c As contactItem, f As MAPIFolder
Set f = Application.GetNamespace("mapi").GetDefaultFolder(olFolderContacts)
For Each tsk In ActiveExplorer.Selection
Debug.Print tsk.ContactNames
conts = Split(tsk.ContactNames, ",")
Debug.Print conts
For cq = 0 To UBound(conts)
Set c = f.Items(conts(cq))
c.UserProperties.Item(FieldName).value = myValue
c.Save
Next
Next
End Sub
 
do you get a dialog that says why each line generated the error?

My guess is that it can't find the object identified by tsk but without an error code, that is just a guess.
 
All that happens is the code lines you gave me turns yellow and nothing shows up describing the error.
 
Well, there is something wrong with the code that feeds that macro - i can only assume its not getting values for FieldName and myValue. I'm not able to test it because of the custom form and features no supported in 2013 so I won't be much help in figuring out where the problem is. sorry.
 
To All,

If this helps to others, I just wanted to explain. Through the forum, we have worked hard to find the way to adjust contacts and their related fields, through selecting tasks that are linked to a contact each one.

Since I have the codes that does it when I select contacts, and I want to adjust contacts if they are in a task, I setup in the contact form, that when I create a task for the contact using a script code of the contact form, it automatically adds to a new text field named as Task Yes/No, the word "Yes". That way I sort a contact folder by the field

Task Yes/No, which then shows me the list of contacts in Tasks, and I can then change them thru my code that changes selected contacts.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P Outlook 2007 update headers Using Outlook 2
P Outlook 2007: Update the Contacts folder entries Outlook VBA and Custom Forms 2
D Outlook 2007 Recovering E-Mails Using Outlook 0
W Transfer Outlook 2016 autocomplete file to Outlook 2007 Using Outlook 1
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2
D Outlook 2007 crashes when opening an email Using Outlook 2
R New chap saying hello and needing advice on Outlook 2007 thumbnails Using Outlook 3
icacream From Outlook 2007 to 2016 ! Using Outlook 9
vodkasoda Object could not be found Error in Outlook 2007 Outlook VBA and Custom Forms 5
S Outlook 2007: Address Cards allow entering text! Why? Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
L Outlook 2007 Separate the Send/Receive functions Using Outlook 2
M Outlook 2007 Contacts Glitch: Creating a new email Using Outlook 1
C Move from Outlook 2007 Enterprise (MOE) to Outlook Pro plus 2007 Using Outlook 1
J reinstalling Outlook 2007 asking for user name & password Using Outlook 14
P outlook addin unloaded in office 2007 Using Outlook 0
B Fonts in Outlook 2007 Using Outlook 4
R Add Exchange Account to existing POP3 Outlook 2007 Profile Using Outlook 0
C out of space in file group Outlook 2007 Using Outlook 2
A Moving archived contents in Outlook 2007 back into working folders Using Outlook 0
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
M Unable to Configure Gmail Account in Outlook 2007 Using Outlook 1
R Outlook 2007 or 2010 - Lock Down Functionality Outlook VBA and Custom Forms 3
S Outlook 2007, windows 10 Font size Using Outlook 1
Diane Poremsky Manually create a POP3 account in Outlook 2007 Using Outlook 0
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
L Outlook 2007 Font Using Outlook 3
J Outlook 2007 connector and Windows 10 Using Outlook 3
R Outlook 2007 - Shared Accounts and Resources without Exchange Server Using Outlook 0

Similar threads

Back
Top