Moving a custom post item

J

Jack

I am attempting to move a custom post item from one folder
to another. I have tried to do this programmatically and
manually without success. When I attempt it via code (VB-
COM addin, see code below) it moves the item to the
deleted folder. When I try manually, it creates a new
default form (contact in this case) in the destination
folder and embeds the post. Both the source and
destination folders have the same forms published to them
and the same default forms (ipm.contact). Also, I can
create a new custom post on both folders without a problem.

Any ideas, please.....

VB Code:
Set oOl = gobjOutlook
For i = 1 To Application.ActiveExplorer.Selection.Count
Set oItem = Application.ActiveExplorer.Selection(i)
oItem.Move oOl.Session.GetDefaultFolder(olFolderContacts)
Next
 
H

Hollis D. Paul

Both the source and
destination folders have the same forms published to them
and the same default forms (ipm.contact).
You should not have a form published in two places. This will really
confuse the cache system. If you need it in two folders, then publish
it to a forms library.

You need to learn how to walk the folders. You need to set a NameSpace
object from the Application object, then set a folder object from the
name of your pst. From there you walk the folder hierarchy, setting
folder objects as you go. (Actually, you only need two folder objects,
for the current one, and the next one down.) Then you would move the
selected object to the that folder. Finally, you open the new object,
change the messageclass field to the name of your custom form, and save
it.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
G

Guest

I am able to get the folders the object resides in, I use
Application.ActiveExplorer.Selection(i) since it is
selected when this code fires. The destination folder is
the contact folder so I get that one with
oOl.Session.GetDefaultFolder(olFolderContacts).

The problem is that once I have these folders I call the
move method it is not working properly. The post gets
moved to the deleted folder, yet if I call this same code
with other itesm (e.g., custom contact forms) it works
fine.

Jack
-----Original Message-----
Both the source and
destination folders have the same forms published to them
and the same default forms (ipm.contact).
You should not have a form published in two places. This will really
confuse the cache system. If you need it in two folders, then publish
it to a forms library.

You need to learn how to walk the folders. You need to set a NameSpace
object from the Application object, then set a folder object from the
name of your pst. From there you walk the folder hierarchy, setting
folder objects as you go. (Actually, you only need two folder objects,
for the current one, and the next one down.) Then you would move the
selected object to the that folder. Finally, you open the new object,
change the messageclass field to the name of your custom form, and save
it.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp? FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA


.
 
H

Hollis D. Paul

The problem is that once I have these folders I call the
move method it is not working properly. The post gets
moved to the deleted folder, yet if I call this same code
with other itesm (e.g., custom contact forms) it works
fine.
A move involves a copy to the desired folder and a deletion in the
original folder. You should see a copy appear in the target folder as
well as in the deleted items folder. Check the number of items in
folder before you try the operation. It is likely that it is getting
there, but you aren't seeing it because you are looking for the custom
form item.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
G

Guest

OK, so now I see the additional item in the destiniation
folder, however, it is not a post, it is a contact (the
folder's default form) with the post as an attachment.

Is there a way to simply move the item and have it show
you as the original item (custom Post) in the destiniation
folder?

Jack

-----Original Message-----
The problem is that once I have these folders I call the
move method it is not working properly. The post gets
moved to the deleted folder, yet if I call this same code
with other itesm (e.g., custom contact forms) it works
fine.
A move involves a copy to the desired folder and a deletion in the
original folder. You should see a copy appear in the target folder as
well as in the deleted items folder. Check the number of items in
folder before you try the operation. It is likely that it is getting
there, but you aren't seeing it because you are looking for the custom
form item.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp? FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA


.
 
H

Hollis D. Paul

Is there a way to simply move the item and have it show
you as the original item (custom Post) in the destiniation
folder?
Did you reset the messageclass field of the item? The whole business
about which icon is showing is one I have ignored. So I can't really
help you on this detail. But one if the reasons it doesn't show right
is that the icon isn't in the directory in which it is looking. So you
should check, in the item's properties, to see where it thinks the icon
image is to be found.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 
G

Guest

I inspected the message class in debug mode ans it is the
correct messageclass. However, if I open the item after
moving it, its messageclass is that of the default form in
the folder.

Are there special considerations in moving post items
amoung folders?
-----Original Message-----
Is there a way to simply move the item and have it show
you as the original item (custom Post) in the destiniation
folder?
Did you reset the messageclass field of the item? The whole business
about which icon is showing is one I have ignored. So I can't really
help you on this detail. But one if the reasons it doesn't show right
is that the icon isn't in the directory in which it is looking. So you
should check, in the item's properties, to see where it thinks the icon
image is to be found.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp? FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA


.
 
H

Hollis D. Paul

Are there special considerations in moving post items
amoung folders?
Well, I suppose there are. When you use the AddItem method to a folder
objects Items collection set, you can specify which form to use. The
code you are using does not specify a form to use. You are assuming
that the process is one of copying the original item byte by byte. But
this is not the way it is done. The new item is created as an empty,
blank form, and field values are copied from one to another.
Unfortunately, the MessageClass field is not one that is copied, as the
new item was created with the default form name. So you have to
experiment with it. You might try adding a custom action to your form,
so that you can use the autoloading function of fields, rather than
using the Move method.

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US

Mukilteo, WA USA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top