Copying data between atbs in a custom form

Status
Not open for further replies.
B

bear

Hello

I have a custom form. Form is a modified appointment with a second tab for a custom form.

Trying to copy data from custom form/second tab to first tab which a standard Appointment page.

First trying to make sure that a user is in a second tab which is called Transportation Form. When code is executed it should take data from some fields in Transportation Form and copy it over to Appointment tab/first tab.

Not sure how to call tabs. Any help would be appreciated

Sub Appt_From_From()

Dim txtBody1 As String

Dim txtBody2 As String

Dim txtBody3 As String

Dim objCurContact As ContactItem

Dim objAppt As AppointmentItem

Set myFolder = Session.GetDefaultFolder(olFolderCalendar)

Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")

On Error GoTo ErrorCode

If Application.ActiveInspector.CurrentItem.Class <> myItem Then

MsgBox "Error,exiting"

GoTo ErrorCode

Else

Set objCurContact = Application.ActiveInspector.CurrentItem

Set objAppt = myItem
 
This calls a certain control on the names page:

dim ctrl as object

Set ctrl=

Application.ActiveInspector.ModifiedFormPages("name").Controls("name")

You don't need to create the myItem object. If you want to test, whether a

certain item uses your modified form, check its MessageClass property.

Best regards

Michael Bauer

Am Fri, 26 Mar 2010 15:26:08 -0400 schrieb bear:


> Hello
> I have a custom form. Form is a modified appointment with a second tab for


a custom form.

> Trying to copy data from custom form/second tab to first tab which a


standard Appointment page.

> First trying to make sure that a user is in a second tab which is called


Transportation Form. When code is executed it should take data from some

fields in Transportation Form and copy it over to Appointment tab/first tab.
> Not sure how to call tabs. Any help would be appreciated

> Sub Appt_From_From()
> Dim txtBody1 As String
> Dim txtBody2 As String
> Dim txtBody3 As String
> Dim objCurContact As ContactItem
> Dim objAppt As AppointmentItem

> Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")

> On Error GoTo ErrorCode

> If Application.ActiveInspector.CurrentItem.Class <> myItem Then
> MsgBox "Error,exiting"
> GoTo ErrorCode

> Else

> Set objCurContact = Application.ActiveInspector.CurrentItem
> Set objAppt = myItem

> .
>
 
Hello

Here is what I have now and it does not seem to find the form. Not sure how it should be refrenced?

Public Sub Appt_From_Contact()

Dim txtBody1 As String

Dim txtBody2 As String

Dim txtBody3 As String

Dim objCurContact As ContactItem

Dim objAppt As AppointmentItem

Dim ins As Outlook.AppointmentItem

Dim con As Outlook.AppointmentItem

Dim ctrl As Object

On Error GoTo ErrorCode

'Set myFolder = Session.GetDefaultFolder(olFolderCalendar)

'Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")

Set ctrl = Application.ActiveInspector.ModifiedFormPages("IPM.Appointment.Tim3.18.2010 ").Controls("DestinationandAddr").Value

If Application.ActiveInspector.CurrentItem.Class <> olAppointment Then

MsgBox "Error,exiting"

GoTo ErrorCode

Else

Set objCurContact = Application.ActiveInspector.CurrentItem

Set objAppt = Application.CreateItem(ctrl)

mb wrote on Sat, 27 March 2010 01:57
> This calls a certain control on the names page:
> dim ctrl as object
> Set ctrl=
> Application.ActiveInspector.ModifiedFormPages("name").Controls( "name")

> You don't need to create the myItem object. If you want to test, whether a
> certain item uses your modified form, check its MessageClass property.

> > Best regards
> Michael Bauer
> Category Manager -

> SAM - The Sending Account Manager:
>

> Am Fri, 26 Mar 2010 15:26:08 -0400 schrieb bear:
>
> > Hello
> > I have a custom form. Form is a modified appointment with a second tab for

> a custom form.
> > Trying to copy data from custom form/second tab to first tab which a

> standard Appointment page.
> > First trying to make sure that a user is in a second tab which is called

> Transportation Form. When code is executed it should take data from some
> fields in Transportation Form and copy it over to Appointment tab/first tab.
> > Not sure how to call tabs. Any help would be appreciated
> > Sub Appt_From_From()
> > Dim txtBody1 As String
> > Dim txtBody2 As String
> > Dim txtBody3 As String
> > Dim objCurContact As ContactItem
> > Dim objAppt As AppointmentItem
> > Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> > Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")
> > On Error GoTo ErrorCode
> > If Application.ActiveInspector.CurrentItem.Class <> myItem Then
> > MsgBox "Error,exiting"
> > GoTo ErrorCode
> > Else
> > Set objCurContact = Application.ActiveInspector.CurrentItem
> > Set objAppt = myItem
> > .
> >
 
Dim Appt as Outlook.AppointmentItem

Dim ctrl as Object

' Assuming the current item is an appointment

Set Appt=Application.ActiveInspector.CurrentItem

if Appt.MessageClass="IPM.Appointment.Tim3.18.2010" Then

' this AppointmentItem is using your custom form

' here you should be able to access the ModifiedFormPage and the control

by their names

else

' this AppointmentItem probably is using the default form

endif

Best regards

Michael Bauer

Am Mon, 29 Mar 2010 12:44:17 -0400 schrieb bear:


> Hello

> Here is what I have now and it does not seem to find the form. Not sure


how it should be refrenced?

> Public Sub Appt_From_Contact()

> Dim txtBody1 As String
> Dim txtBody2 As String
> Dim txtBody3 As String
> Dim objCurContact As ContactItem
> Dim objAppt As AppointmentItem
> Dim ins As Outlook.AppointmentItem
> Dim con As Outlook.AppointmentItem
> Dim ctrl As Object
> On Error GoTo ErrorCode

> 'Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> 'Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")

> Set ctrl =


Application.ActiveInspector.ModifiedFormPages("IPM.Appointment.Tim3.18.2010

").Controls("DestinationandAddr").Value
> If Application.ActiveInspector.CurrentItem.Class <> olAppointment Then
> MsgBox "Error,exiting"
> GoTo ErrorCode
> Else

> Set objCurContact = Application.ActiveInspector.CurrentItem
> Set objAppt = Application.CreateItem(ctrl)

> mb wrote on Sat, 27 March 2010 01:57
> > This calls a certain control on the names page:
> > dim ctrl as object
> > Set ctrl=
> > Application.ActiveInspector.ModifiedFormPages("name").Controls( "name")
>

>> You don't need to create the myItem object. If you want to test, whether


a
> > certain item uses your modified form, check its MessageClass property.
>

>> > > Best regards
> > Michael Bauer
> > Category Manager -

> > SAM - The Sending Account Manager:
> >

>
>
>> Am Fri, 26 Mar 2010 15:26:08 -0400 schrieb bear:
> >
> >> Hello
> >> I have a custom form. Form is a modified appointment with a second tab


for
> > a custom form.
> >
>>> Trying to copy data from custom form/second tab to first tab which a

> > standard Appointment page.
> >
>>> First trying to make sure that a user is in a second tab which is called

> > Transportation Form. When code is executed it should take data from some
> > fields in Transportation Form and copy it over to Appointment tab/first


tab.
> >> Not sure how to call tabs. Any help would be appreciated
> >
>>
>>> Sub Appt_From_From()
> >> Dim txtBody1 As String
> >> Dim txtBody2 As String
> >> Dim txtBody3 As String
> >> Dim objCurContact As ContactItem
> >> Dim objAppt As AppointmentItem
> >
>>> Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> >> Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")
> >
>>> On Error GoTo ErrorCode
> >
>>> If Application.ActiveInspector.CurrentItem.Class <> myItem Then
> >> MsgBox "Error,exiting"
> >> GoTo ErrorCode
> >
>>> Else
> >
>>> Set objCurContact = Application.ActiveInspector.CurrentItem
> >> Set objAppt = myItem
> >
>>> .
> >>


> .
>
 
Re: Copying data between tabs in a custom form

Hello

I made modifications. here is what I have now and get an error -2147024809. Error comes up right after ModifiedFormPages("Transportation Form").Controls("DestinationandAddr"). Does it care that there is a space between words Transportation and Form?

Sub FormtoAppt()

Dim txtBody1 As String

Dim txtBody2 As String

Dim txtBody3 As String

Dim objCurContact As ContactItem

Dim objAppt As AppointmentItem

Dim ctrl As Object

Dim Appt As Outlook.AppointmentItem

On Error GoTo ErrorCode

Set Appt = Application.ActiveInspector.CurrentItem

If Appt.MessageClass = "IPM.Appointment.Tim3.18.2010" Then

Set ctrl = Application.ActiveInspector.ModifiedFormPages("Transportation Form").Controls("DestinationandAddr")

Set objCurContact = Application.ActiveInspector.CurrentItem

Set objAppt = Application.CreateItem(ctrl)

> .......................

mb wrote on Tue, 30 March 2010 02:57
> Dim Appt as Outlook.AppointmentItem
> Dim ctrl as Object

> ' Assuming the current item is an appointment
> Set Appt=Application.ActiveInspector.CurrentItem

> if Appt.MessageClass="IPM.Appointment.Tim3.18.2010" Then
> ' this AppointmentItem is using your custom form
> ' here you should be able to access the ModifiedFormPage and the control
> by their names
> else
> ' this AppointmentItem probably is using the default form
> endif

> > Best regards
> Michael Bauer
> Category Manager -

> SAM - The Sending Account Manager:
>

> Am Mon, 29 Mar 2010 12:44:17 -0400 schrieb bear:
>
> > Hello
> > Here is what I have now and it does not seem to find the form. Not sure

> how it should be refrenced?
> > Public Sub Appt_From_Contact()
> > Dim txtBody1 As String
> > Dim txtBody2 As String
> > Dim txtBody3 As String
> > Dim objCurContact As ContactItem
> > Dim objAppt As AppointmentItem
> > Dim ins As Outlook.AppointmentItem
> > Dim con As Outlook.AppointmentItem
> > Dim ctrl As Object
> > On Error GoTo ErrorCode
> > 'Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> > 'Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")
> > Set ctrl =

> Application.ActiveInspector.ModifiedFormPages("IPM.Appointment.Tim3.18.2010
> ").Controls("DestinationandAddr").Value
> > If Application.ActiveInspector.CurrentItem.Class <> olAppointment Then
> > MsgBox "Error,exiting"
> > GoTo ErrorCode
> > Else
> > Set objCurContact = Application.ActiveInspector.CurrentItem
> > Set objAppt = Application.CreateItem(ctrl)
> > mb wrote on Sat, 27 March 2010 01:57
> >> This calls a certain control on the names page:
> >> dim ctrl as object
> >> Set ctrl=
> >> Application.ActiveInspector.ModifiedFormPages("name").Controls( "name")
> >
> >> You don't need to create the myItem object. If you want to test, whether

> a
> >> certain item uses your modified form, check its MessageClass property.
> >
> >> > >> Best regards
> >> Michael Bauer
> >> Category Manager -

> >> SAM - The Sending Account Manager:
> >>

> >
> >
> >> Am Fri, 26 Mar 2010 15:26:08 -0400 schrieb bear:
> >
> >>> Hello
> >>> I have a custom form. Form is a modified appointment with a second tab

> for
> >> a custom form.
> >>
> >>> Trying to copy data from custom form/second tab to first tab which a
> >> standard Appointment page.
> >>
> >>> First trying to make sure that a user is in a second tab which is called
> >> Transportation Form. When code is executed it should take data from some
> >> fields in Transportation Form and copy it over to Appointment tab/first

> tab.
> >>> Not sure how to call tabs. Any help would be appreciated
> >>
> >>
> >>> Sub Appt_From_From()
> >>> Dim txtBody1 As String
> >>> Dim txtBody2 As String
> >>> Dim txtBody3 As String
> >>> Dim objCurContact As ContactItem
> >>> Dim objAppt As AppointmentItem
> >>
> >>> Set myFolder = Session.GetDefaultFolder(olFolderCalendar)
> >>> Set myItem = myFolder.Items.Add("IPM.Appointment.Tim3.18.2010")
> >>
> >>> On Error GoTo ErrorCode
> >>
> >>> If Application.ActiveInspector.CurrentItem.Class <> myItem Then
> >>> MsgBox "Error,exiting"
> >>> GoTo ErrorCode
> >>
> >>> Else
> >>
> >>> Set objCurContact = Application.ActiveInspector.CurrentItem
> >>> Set objAppt = myItem
> >>
> >>> .
> >>>

> > .
> >
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
E Copying data from e-mail attachement to EXCEL file via macro Outlook VBA and Custom Forms 38
N error when copying outlook data "can not copy: the path too deep" Using Outlook 6
R Copying Data from Exchange to PST file Outlook VBA and Custom Forms 1
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
P Copying ALL calendar entries from Calender in PST file to IMAP OST file? Using Outlook 1
R VBA for copying sent email to current folder under a shared mailbox Outlook VBA and Custom Forms 17
E Copying the whole e-mail body into excel Outlook VBA and Custom Forms 0
T Copying Outlook Account Setup For Desktop App Using Outlook 5
J Outlook - 2013 - Error msg when copying folders from Online Archives to another user's mailbox Using Outlook 0
Thiago Manzano Copying E-mails to a folder on HD Using Outlook 1
Diane Poremsky Mark Sent Items as Read After Copying with a Rule Using Outlook 0
crazyboy Copying BCM database from backed up mounted image to new drive BCM (Business Contact Manager) 2
oliv- Prevent copying shared contacts Outlook VBA and Custom Forms 5
Paul Butticaz Copying Contacts from SharePoint List (connected to Outlook) to another Conacts folder Using Outlook 1
K Outlook 2010 Not responding after IMAP folder deletion or copying. Using Outlook 2
Mary B Outlook 2013: Rule for copying new email to folder & marking that copy as read Using Outlook 1
S Calendar items are not being uploaded to outlook.com after copying Using Outlook.com accounts in Outlook 1
P open reminders missing after copying outlook pst file Using Outlook 2
L Copying Emails using drag and drop Using Outlook 2
O New to Outlook 2013, dealing with copying vs. moving sent items Using Outlook 0
S Recover messages that disappeared when copying to folder Using Outlook 1
S Copying multiple messages to folders and keeping date/time detail Using Outlook 1
D Copying POP3 folders from Inbox to IMAP Inbox in Outlook 2003 Using Outlook 0
M Copying setups for mutiple users Using Outlook 2
T Location and simple copying of emails and settings, OL 2010 and Win 7 64bit. Using Outlook 3
A Copying additional contact fields when chosing "Contact from the same company" Using Outlook 5
A Copying cc email addresses to Excel - does not copy the <joe.bloggs@isp.com> Using Outlook 1
S Search Indexing (Copying Folders) Using Outlook 0
E Copying multiple folders to PST Outlook VBA and Custom Forms 2
R copying a custom view from a public folder and distributing programatically Outlook VBA and Custom Forms 3
N Copying outlook macros between pcs Outlook VBA and Custom Forms 1
V Copying contents from one field to another field Outlook VBA and Custom Forms 6
C Advanced search terms for "Outlook Data File" Using Outlook 1
C Populate form data into message body Outlook VBA and Custom Forms 1
CWM550 Saving Data: Don't check certain folders Using Outlook 2
CWM550 Importing " Old Skool" Data Using Outlook 0
W Create a Quick Step or VBA to SAVE AS PDF in G:|Data|Client File Outlook VBA and Custom Forms 1
Wotme create email only data file Using Outlook 1
V Backup Calendar, Contacts, Tasks in an POP3 data file Using Outlook 3
e_a_g_l_e_p_i Changing where data .pst is saved to Using Outlook 3
J Deliver new messages to New or Existing Data File? Using Outlook 2
G Outlook 2016: Want IMAP Data Files on My D: Drive and Not C: Drive Using Outlook 1
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
D Outlook 2016 Unable to load Outlook data pst file Using Outlook 5
V Form data not sending for some users Outlook VBA and Custom Forms 2
D Outlook VBA error extracting property data from GetRules collection Outlook VBA and Custom Forms 10
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 10
T How can Exchange be configured to sync/push one-way so that the server data can't be affected Exchange Server Administration 0
T Extract Data From Outlook Tasks Using Outlook 0
F outlook.com Exchane Server corrupts data Since September 2019 Using Outlook.com accounts in Outlook 6

Similar threads

Back
Top