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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

copy values from one to another form



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 2nd 07, 04:51 PM posted to microsoft.public.outlook.program_vba
Dasha
external usenet poster
 
Posts: 18
Default copy values from one to another form

Hi!

Can anyone help me with the following:

I've opened saved item (based on custom IPM.POST form), and when the
user clicks a button I need to create a duplicate item and copy the
data from the original form to the new one.

How can I do this using VBScript?

Many thanks for any help in advance.

Dasha

  #2  
Old February 2nd 07, 05:01 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default copy values from one to another form

I'd use the Item.Copy method to create the copy already populated with the
original data. Just have your button click event copy the item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dasha" wrote in message
ups.com...
Hi!

Can anyone help me with the following:

I've opened saved item (based on custom IPM.POST form), and when the
user clicks a button I need to create a duplicate item and copy the
data from the original form to the new one.

How can I do this using VBScript?

Many thanks for any help in advance.

Dasha


  #3  
Old February 2nd 07, 04:59 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default copy values from one to another form

Why not just create a copy of the whole item?

Set newItem = originalItem.Copy
newItem.Save

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dasha" wrote in message ups.com...
Hi!

Can anyone help me with the following:

I've opened saved item (based on custom IPM.POST form), and when the
user clicks a button I need to create a duplicate item and copy the
data from the original form to the new one.

How can I do this using VBScript?

Many thanks for any help in advance.

Dasha

  #4  
Old February 5th 07, 12:13 PM posted to microsoft.public.outlook.program_vba
Dasha
external usenet poster
 
Posts: 18
Default copy values from one to another form

I'm using Exchange workflow, so when I do Item.Copy I get error "Adhoc
workflows are disallowed for this folder. The new process instance
cannot be created". Do you know what the problem is?

  #5  
Old February 5th 07, 01:44 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default copy values from one to another form

If you're not allowed to create new items in that folder except through the workflow process, then create a new IPM.Post in another folder with the MAPIFolder.Items.Add method, then copy property values one by one. You should be able to do most if not all by iterating the ItemProperties collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Dasha" wrote in message ups.com...
I'm using Exchange workflow, so when I do Item.Copy I get error "Adhoc
workflows are disallowed for this folder. The new process instance
cannot be created". Do you know what the problem is?

  #6  
Old February 8th 07, 07:13 AM posted to microsoft.public.outlook.program_vba
Dasha
external usenet poster
 
Posts: 18
Default copy values from one to another form

It's easier then I thought:
Set olns = Item.Application.GetNameSpace("MAPI")
Set MyFolder1 = olns.Folders("Public Folders")
Set MyFolder2 = MyFolder1.Folders("All Public Folders")
Set MyFolder3 = MyFolder2.Folders("payment")
Set MyItem = MyFolder3.Items.Add

'filling fields
MyItem.UserProperties("fCardType").Value =
Item.UserProperties("fCardType").Value

Thanks to all

 




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
Outlook Appoinment Form customised but values of the user defined Safal Outlook - Using Forms 1 November 15th 06 02:18 PM
Populate Subject line with form values Lime Outlook - Using Forms 3 November 3rd 06 10:06 PM
Custom Form doesn't have any values in another Calendar ML Outlook - Using Forms 3 April 13th 06 09:41 PM
How to copy a form from personal to another form library? cruttley Outlook - Using Forms 5 March 22nd 06 09:02 PM
Get values of custom variables from customised contact form Michael Anderson Outlook and VBA 1 February 6th 06 10:06 PM


All times are GMT +1. The time now is 10:19 AM.


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.