View Single Post
  #3  
Old October 2nd 07, 10:26 PM posted to microsoft.public.outlook.program_forms
Job[_2_]
external usenet poster
 
Posts: 14
Default custom form scripting error

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.


Ads