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

Moving a Custom Form from folder to folder in Outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 19th 07, 06:52 PM posted to microsoft.public.outlook.program_forms
koops2121
external usenet poster
 
Posts: 2
Default Moving a Custom Form from folder to folder in Outlook 2007

I have a task form that I move from folder to folder in Outlook public
folders.
Basically when you save and close it should move to the folder above it.
This worked fine before with Outlook 2000/2003. Using the code:

Sub Item_Close
oTask.Move oFolder
End Sub

Now in 2007 it doesn't do anything.
I've also tried changing it so that it copies the form, then moves the copy:

Sub Item_Close
Set ocTask = oTask.Copy
ocTask.Move oFolder
End Sub

This creates the new task, however none of the custom fields come over with
it for whatever reason.

Does anyone have any suggestions?
Thanks,

Ads
  #2  
Old September 19th 07, 08:33 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Moving a Custom Form from folder to folder in Outlook 2007

What do you actually see on the new task? Where is your form published? To work in this scenario, it needs to be published either to Organizational Forms, to Personal Forms, or to the forms library on each folder where items are stored. Also, you may need to create the custom fields in the target folder, if you want them to be displayed there in folder views.

Note that you are moving an item, not a form. A form is the code/UI template. It is the item that contains the data that the form displays.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"koops2121" u37561@uwe wrote in message news:78760171b4d50@uwe...
I have a task form that I move from folder to folder in Outlook public
folders.
Basically when you save and close it should move to the folder above it.
This worked fine before with Outlook 2000/2003. Using the code:

Sub Item_Close
oTask.Move oFolder
End Sub

Now in 2007 it doesn't do anything.
I've also tried changing it so that it copies the form, then moves the copy:

Sub Item_Close
Set ocTask = oTask.Copy
ocTask.Move oFolder
End Sub

This creates the new task, however none of the custom fields come over with
it for whatever reason.

Does anyone have any suggestions?
Thanks,

  #3  
Old September 19th 07, 09:06 PM posted to microsoft.public.outlook.program_forms
koops2121
external usenet poster
 
Posts: 2
Default Moving a Custom Form from folder to folder in Outlook 2007

My form is published to each of the public folders. It's published with the
message class "Base", then it gets moved to the next folder as "Quoted".
When copied it appears fine, however none of the user defined fields are
populated. It does however copy stuff like Subject and Due Date. So both in
the listing and viewing the item user defined fields are null.
I checked the "user-defined fields in this folder" and CompanyName is in
there however it appears blank when copied.

  #4  
Old September 19th 07, 09:17 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Moving a Custom Form from folder to folder in Outlook 2007

then it gets moved to the next folder as "Quoted".

Could you explain what you mean by that, please? A code snippet might be instructive.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"koops2121" u37561@uwe wrote in message news:78772c54567fa@uwe...
My form is published to each of the public folders. It's published with the
message class "Base", then it gets moved to the next folder as "Quoted".
When copied it appears fine, however none of the user defined fields are
populated. It does however copy stuff like Subject and Due Date. So both in
the listing and viewing the item user defined fields are null.
I checked the "user-defined fields in this folder" and CompanyName is in
there however it appears blank when copied.

  #5  
Old September 21st 07, 04:44 PM posted to microsoft.public.outlook.program_forms
koops2121 via OfficeKB.com
external usenet poster
 
Posts: 3
Default Moving a Custom Form from folder to folder in Outlook 2007

Function Item_Close()

If MoveQuoted = 1 Then
Set oApp = CreateObject("Outlook.Application")
Set oName = oApp.GetNamespace("MAPI")
Set oFolder = Item.Parent

If oFolder.EntryID =
"000000001A447390AA6611CD9BC800AA002FC45A0300D27A6 408BFB611469494C39DB2EE" &
_
"75A7000000096E430000" Then
Set oFolder = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary")
Set oFolder2 = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary").Folders.
Item("Quoted")
Set oTask = oName.GetItemFromID(Item.EntryID)
oTask.Close(0)
oTask.Move oFolder2
End If

Set oFolder = Nothing
Set oFolder2 = Nothing
Set oName = Nothing
Set oApp = Nothing

End If
End Function

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...forms/200709/1

  #6  
Old September 21st 07, 05:05 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Moving a Custom Form from folder to folder in Outlook 2007

So you're trying to sneak around the limitation against calling Move inside the Close event handler (documented at http://outlookcode.com/article.aspx?id=59)?

I can't explain why the moved item would be missing data in a custom field. Do you see the same behavior if you move the item manually? What happens if you delete that field from the folder's User-defined Fields and then add it again. (This will not affect any data if you do it at the folder level.)

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"koops2121 via OfficeKB.com" u37561@uwe wrote in message news:788e089a9b7f6@uwe...
Function Item_Close()

If MoveQuoted = 1 Then
Set oApp = CreateObject("Outlook.Application")
Set oName = oApp.GetNamespace("MAPI")
Set oFolder = Item.Parent

If oFolder.EntryID =
"000000001A447390AA6611CD9BC800AA002FC45A0300D27A6 408BFB611469494C39DB2EE" &
_
"75A7000000096E430000" Then
Set oFolder = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary")
Set oFolder2 = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary").Folders.
Item("Quoted")
Set oTask = oName.GetItemFromID(Item.EntryID)
oTask.Close(0)
oTask.Move oFolder2
End If

Set oFolder = Nothing
Set oFolder2 = Nothing
Set oName = Nothing
Set oApp = Nothing

End If
End Function

My form is published to each of the public folders. It's published with the
message class "Base", then it gets moved to the next folder as "Quoted".
When copied it appears fine, however none of the user defined fields are
populated. It does however copy stuff like Subject and Due Date. So both in
the listing and viewing the item user defined fields are null.
I checked the "user-defined fields in this folder" and CompanyName is in
there however it appears blank when copied.

  #7  
Old September 24th 07, 07:53 PM posted to microsoft.public.outlook.program_forms
koops2121 via OfficeKB.com
external usenet poster
 
Posts: 3
Default Moving a Custom Form from folder to folder in Outlook 2007

You got it! Lol.
When I move the item it moves normally and all the fields are filled in.
However I'm unsure if it's a one-off form that gets created or not.

I tried deleting the user-defined fields in the folder remade them with no
success.

Is what I'm doing unheard of? Does no one else programmatically move items
from folder to folder? If so how do they do it?

--
Message posted via http://www.officekb.com

  #8  
Old September 24th 07, 08:10 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Moving a Custom Form from folder to folder in Outlook 2007

It's moving a custom form item inside the Close event that's a no-no.

You can see easily if it's a one-off by comparing the values of the Size and MessageClass properties with those of a custom form item moved manually.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"koops2121 via OfficeKB.com" u37561@uwe wrote in message news:78b5663d1e826@uwe...
You got it! Lol.
When I move the item it moves normally and all the fields are filled in.
However I'm unsure if it's a one-off form that gets created or not.

I tried deleting the user-defined fields in the folder remade them with no
success.

Is what I'm doing unheard of? Does no one else programmatically move items
from folder to folder? If so how do they do it?


"Sue Mosher [MVP-Outlook]" wrote in message ...
So you're trying to sneak around the limitation against calling Move inside the Close event handler (documented at http://outlookcode.com/article.aspx?id=59)?

I can't explain why the moved item would be missing data in a custom field. Do you see the same behavior if you move the item manually? What happens if you delete that field from the folder's User-defined Fields and then add it again. (This will not affect any data if you do it at the folder level.)


"koops2121 via OfficeKB.com" u37561@uwe wrote in message news:788e089a9b7f6@uwe...
Function Item_Close()

If MoveQuoted = 1 Then
Set oApp = CreateObject("Outlook.Application")
Set oName = oApp.GetNamespace("MAPI")
Set oFolder = Item.Parent

If oFolder.EntryID =
"000000001A447390AA6611CD9BC800AA002FC45A0300D27A6 408BFB611469494C39DB2EE" &
_
"75A7000000096E430000" Then
Set oFolder = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary")
Set oFolder2 = oName.Folders.Item("Public Folders").Folders.Item("All
Public
Folders").Folders.Item("Procurement").Folders.Item ("Calgary").Folders.
Item("Quoted")
Set oTask = oName.GetItemFromID(Item.EntryID)
oTask.Close(0)
oTask.Move oFolder2
End If

Set oFolder = Nothing
Set oFolder2 = Nothing
Set oName = Nothing
Set oApp = Nothing

End If
End Function

My form is published to each of the public folders. It's published with the
message class "Base", then it gets moved to the next folder as "Quoted".
When copied it appears fine, however none of the user defined fields are
populated. It does however copy stuff like Subject and Due Date. So both in
the listing and viewing the item user defined fields are null.
I checked the "user-defined fields in this folder" and CompanyName is in
there however it appears blank when copied.

  #9  
Old September 24th 07, 11:14 PM posted to microsoft.public.outlook.program_forms
koops2121 via OfficeKB.com
external usenet poster
 
Posts: 3
Default Moving a Custom Form from folder to folder in Outlook 2007

Ok, thanks a lot for your help!
Much appreaciated!

--
Message posted via http://www.officekb.com

 




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
Public Folder with Custom Form Joe Outlook - Using Forms 4 March 5th 07 04:28 PM
Custom form in public folder always wants to save changes Tom G. Outlook - Using Forms 6 November 10th 06 07:59 PM
Outlook 2007 Favorite folder dissapeared after moving pst files. [email protected] Outlook - General Queries 2 September 28th 06 04:21 AM
How to use a custom form as a default folder form ? David Outlook - Using Forms 14 July 17th 06 06:14 AM
Fields get created in folder, not in custom form kkarre Outlook - Using Forms 2 February 2nd 06 08:56 PM


All times are GMT +1. The time now is 11:37 PM.


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