A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

custom form scripting error



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 2nd 07, 12:43 AM posted to microsoft.public.outlook.program_forms
Job
external usenet poster
 
Posts: 14
Default custom form scripting error

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  
Old October 2nd 07, 01:46 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default custom form scripting error

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  
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.


  #4  
Old October 3rd 07, 12:44 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default custom form scripting error

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  
Old October 4th 07, 02:55 AM posted to microsoft.public.outlook.program_forms
Job[_2_]
external usenet poster
 
Posts: 14
Default custom form scripting error

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  
Old October 2nd 07, 10:45 PM posted to microsoft.public.outlook.program_forms
Job[_2_]
external usenet poster
 
Posts: 14
Default custom form scripting error

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 12:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.