![]() |
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
|
|||
|
|||
![]()
Here's the code..
Function UpdateTask() clt_Client = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_Client2").Value ctl_Project = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_Project").Value ctl_ClientLead = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_ClientLead").Value clt_TeamLead = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_TeamLead").Value ctl_Categories = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_Categories").Value ctl_PercentComplete = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_PctComplete").Value ctl_Status = Item.GetInspector.ModifiedFormPages("PM Task").Controls("cmbo_Status").Value ctl_pmo_WBS = Item.GetInspector.ModifiedFormPages("PM Task").Controls("txt_WBS").Value ctl_Subject = Item.GetInspector.ModifiedFormPages("PM Task").Controls("txt_Task").Value ctl_TotalWork = Item.GetInspector.ModifiedFormPages("PM Task").Controls("txt_TotalWork").Value ctl_BillRate = Item.GetInspector.ModifiedFormPages("PM Task").Controls("txt_BillRate").Value ctl_Cost = Item.GetInspector.ModifiedFormPages("PM Task").Controls("txt_Cost").Value 'ctl_Body = Item.GetInspector.ModifiedFormPages("PM Task")."_DocSiteControl1".Value 'ctl_Complete = Item.GetInspector.ModifiedFormPages("PM Task").Controls("Complete").Value b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... For i = 1 To RemoteFolder.Items.Count Set objItem = RemoteFolder.Items(i).ItemProperties If objItem.Item("Subject").Value = c Then objItem.Assign 'With RemoteFolder.Items(i) ' objItem.Item("Client").Value = clt_Client ' objItem.Item("Project").Value = ctl_Project ' objItem.Item("ClientLead").Value = ctl_ClientLead ' objItem.Item("TeamLead").Value = clt_TeamLead ' objItem.Item("Categories").Value = ctl_Categories ' objItem.Item("PercentComplete").Value = ctl_PercentComplete ' objItem.Item("Status").Value = ctl_Status ' objItem.Item("WBS").Value = ctl_pmo_WBS ' objItem.Item("Subject").Value = ctl_Subject ' objItem.Item("Total Work").Value = ctl_TotalWork ' objItem.Item("BillRate").Value = ctl_BillRate ' objItem.Item("Cost").Value = ctl_Cost ' RemoteFolder.Items(i).Save 'End With msgbox objItem.Item("Subject").Value End If Next End If '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. Any help is greatly appreciated. Cheers |
#2
|
|||
|
|||
![]()
Have you checked to make sure that myRecipient is resolving to an Exchange user and not a record in the user's Contacts folder? Checked permission on the other mailbox's Tasks folder?
BTW, this is not a good way to return a property value, because there is no guarantee that 39 will be the same property every time: b = ItemProperties.Item(39).Value 'Owner You should use the name of the property instead and also include the parent object or use the basic syntax: b = Item.Owner -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Job" wrote in message ... Here's the code.. Function UpdateTask() b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. |
#3
|
|||
|
|||
![]()
Sue,
The name is resolved to the Exchange server, and I have ownership rights to the user's tasks..thanks for the tip on property values.. "Sue Mosher [MVP-Outlook]" wrote in message ... Have you checked to make sure that myRecipient is resolving to an Exchange user and not a record in the user's Contacts folder? Checked permission on the other mailbox's Tasks folder? BTW, this is not a good way to return a property value, because there is no guarantee that 39 will be the same property every time: b = ItemProperties.Item(39).Value 'Owner You should use the name of the property instead and also include the parent object or use the basic syntax: b = Item.Owner -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Job" wrote in message ... Here's the code.. Function UpdateTask() b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. |
#4
|
|||
|
|||
![]()
One thing I overlooked earlier: You need to declare olFolderTasks as a constant or use its literal value. VBScript knows nothing about ol* constants.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Job" wrote in message ... Sue, The name is resolved to the Exchange server, and I have ownership rights to the user's tasks..thanks for the tip on property values.. "Sue Mosher [MVP-Outlook]" wrote in message ... Have you checked to make sure that myRecipient is resolving to an Exchange user and not a record in the user's Contacts folder? Checked permission on the other mailbox's Tasks folder? BTW, this is not a good way to return a property value, because there is no guarantee that 39 will be the same property every time: b = ItemProperties.Item(39).Value 'Owner You should use the name of the property instead and also include the parent object or use the basic syntax: b = Item.Owner "Job" wrote in message ... Here's the code.. Function UpdateTask() b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. |
#5
|
|||
|
|||
![]()
Thanks Sue that fixed that issue.
Cheers "Sue Mosher [MVP-Outlook]" wrote in message ... One thing I overlooked earlier: You need to declare olFolderTasks as a constant or use its literal value. VBScript knows nothing about ol* constants. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Job" wrote in message ... Sue, The name is resolved to the Exchange server, and I have ownership rights to the user's tasks..thanks for the tip on property values.. "Sue Mosher [MVP-Outlook]" wrote in message ... Have you checked to make sure that myRecipient is resolving to an Exchange user and not a record in the user's Contacts folder? Checked permission on the other mailbox's Tasks folder? BTW, this is not a good way to return a property value, because there is no guarantee that 39 will be the same property every time: b = ItemProperties.Item(39).Value 'Owner You should use the name of the property instead and also include the parent object or use the basic syntax: b = Item.Owner "Job" wrote in message ... Here's the code.. Function UpdateTask() b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. |
#6
|
|||
|
|||
![]()
Also, as I mentioned before, the method works in vba, just not very familiar
with vbscript and thought maybe was a syntax error, but found all the examples I could and they all look like what I've used.. "Sue Mosher [MVP-Outlook]" wrote in message ... Have you checked to make sure that myRecipient is resolving to an Exchange user and not a record in the user's Contacts folder? Checked permission on the other mailbox's Tasks folder? BTW, this is not a good way to return a property value, because there is no guarantee that 39 will be the same property every time: b = ItemProperties.Item(39).Value 'Owner You should use the name of the property instead and also include the parent object or use the basic syntax: b = Item.Owner -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Job" wrote in message ... Here's the code.. Function UpdateTask() b = ItemProperties.Item(39).Value 'Owner c = ItemProperties.Item("Subject").Value 'Subject 'msgbox a & b & c Set olNs = Application.GetNameSpace("MAPI") Set myRecipient = olNs.CreateRecipient(b) myRecipient.Resolve If myRecipient.Resolved Then Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) 'This is where the error comes in... '---------------------- The error come from the line: Set RemoteFolder = olNs.GetSharedDefaultFolder(myRecipient, olFolderTasks) The error is "invalid procedure call or argument:Olns.Getshareddefaultfolder..." The point of the code is to change a task on a shared folder from another user from the task when opened (and is the custom form). I've been able to replicate the functionality, only using a few fields in VBA, but I wanted it to be part of the currently opened custom for. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Publish custom form MAPI error | jharris | Outlook - Using Forms | 2 | November 22nd 06 04:41 PM |
custom TASK REQUEST form error | Cass | Outlook - General Queries | 1 | October 4th 06 08:28 PM |
custom TASK REQUEST form error | Cass | Outlook - General Queries | 0 | October 3rd 06 04:51 PM |
Custom contact form error | Cris Stout | Outlook - Using Contacts | 0 | September 28th 06 11:48 PM |
Script Error in Custom Form | Bryan Dickerson | Outlook - Using Forms | 5 | April 18th 06 06:46 PM |