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

BillingInformation field



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 4th 06, 08:04 PM posted to microsoft.public.outlook.program_vba
Juan J
external usenet poster
 
Posts: 4
Default BillingInformation field

Hi
I have some code that copies an appointment from one calendar to another (a
different PST ) and it works fine when you create that appointment. What I
need to do now is to reflect changes in the original appointment into the
second one, but I need to make sure that no matter what is changed in the
appointment, the "find" method still can find the copy of the appointment.
For example I can´t do the search based in date, subject or status since I
can´t trap the event before the change has taken place so the "find" method
would fail to find the record in the second calendar. To do this I used the
billinginformation field to put some data that would identify both the
original and the copied record. The problem is that the code seems to write
the information in the field of both appointments but when I retrieve the
field of the changed appointment it is shown in blank (no data in it) so the
find method fails. Anybody knows why the value is not kept in the field?
Thanks.
Attached you will find the coding
Dim myOlApp As New Outlook.Application
Public WithEvents CalendarItems As Outlook.Items

Public Sub Initialize_handler()
Set CalendarItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderCalendar).Items
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub CalendarItems_Itemadd(ByVal Item As Object)
Dim mycopiedappt As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Item.BillingInformation = Item.LastModificationTime
MsgBox Item.BillingInformation
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")
Set mycopiedappt = Item.Copy
MsgBox mycopiedappt.BillingInformation
mycopiedappt.Move OPalmFolder
End Sub

Private Sub CalendarItems_Itemchange(ByVal Item As Object)
Dim mychgappt As Outlook.AppointmentItem
Dim OCalItem As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Dim OStr As String
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")

OStr = "[BillingInformation]=" & Item.BillingInformation
'(here the item.billinginformation data returns blank or ""
Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)

If TypeName(OCalItem) "Nothing" Then
OCalItem.Delete
Set mychgappt = Item.Copy
mychgappt.Move OPalmFolder
Else
MsgBox "Can´t find corresponding appointment"
End If
End Sub


Ads
  #2  
Old August 5th 06, 09:13 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default BillingInformation field

Am Fri, 4 Aug 2006 11:04:02 -0700 schrieb Juan J:

Instead:

Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)


This change should do it:

.....Find("[BillingInformation]='" & Item.BillingInformation & "'")

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi
I have some code that copies an appointment from one calendar to another

(a
different PST ) and it works fine when you create that appointment. What I
need to do now is to reflect changes in the original appointment into the
second one, but I need to make sure that no matter what is changed in the
appointment, the "find" method still can find the copy of the appointment.
For example I can´t do the search based in date, subject or status since I
can´t trap the event before the change has taken place so the "find"

method
would fail to find the record in the second calendar. To do this I used

the
billinginformation field to put some data that would identify both the
original and the copied record. The problem is that the code seems to

write
the information in the field of both appointments but when I retrieve the
field of the changed appointment it is shown in blank (no data in it) so

the
find method fails. Anybody knows why the value is not kept in the field?
Thanks.
Attached you will find the coding
Dim myOlApp As New Outlook.Application
Public WithEvents CalendarItems As Outlook.Items

Public Sub Initialize_handler()
Set CalendarItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderCalendar).Items
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub CalendarItems_Itemadd(ByVal Item As Object)
Dim mycopiedappt As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Item.BillingInformation = Item.LastModificationTime
MsgBox Item.BillingInformation
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")
Set mycopiedappt = Item.Copy
MsgBox mycopiedappt.BillingInformation
mycopiedappt.Move OPalmFolder
End Sub

Private Sub CalendarItems_Itemchange(ByVal Item As Object)
Dim mychgappt As Outlook.AppointmentItem
Dim OCalItem As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Dim OStr As String
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")

OStr = "[BillingInformation]=" & Item.BillingInformation
'(here the item.billinginformation data returns blank or ""
Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)

If TypeName(OCalItem) "Nothing" Then
OCalItem.Delete
Set mychgappt = Item.Copy
mychgappt.Move OPalmFolder
Else
MsgBox "Can´t find corresponding appointment"
End If
End Sub

  #3  
Old August 6th 06, 01:25 AM posted to microsoft.public.outlook.program_vba
Juan J
external usenet poster
 
Posts: 4
Default BillingInformation field

Thanks for the tip,
the problem is that the object has a "" value (if I do a msgbox to the
Item.BillingInformation sentence, it prints an empty box) For some reason the
recorded value in the field gets erased.
Thanks




"Michael Bauer [MVP - Outlook]" escribió:

Am Fri, 4 Aug 2006 11:04:02 -0700 schrieb Juan J:

Instead:

Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)


This change should do it:

.....Find("[BillingInformation]='" & Item.BillingInformation & "'")

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi
I have some code that copies an appointment from one calendar to another

(a
different PST ) and it works fine when you create that appointment. What I
need to do now is to reflect changes in the original appointment into the
second one, but I need to make sure that no matter what is changed in the
appointment, the "find" method still can find the copy of the appointment.
For example I can´t do the search based in date, subject or status since I
can´t trap the event before the change has taken place so the "find"

method
would fail to find the record in the second calendar. To do this I used

the
billinginformation field to put some data that would identify both the
original and the copied record. The problem is that the code seems to

write
the information in the field of both appointments but when I retrieve the
field of the changed appointment it is shown in blank (no data in it) so

the
find method fails. Anybody knows why the value is not kept in the field?
Thanks.
Attached you will find the coding
Dim myOlApp As New Outlook.Application
Public WithEvents CalendarItems As Outlook.Items

Public Sub Initialize_handler()
Set CalendarItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderCalendar).Items
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub CalendarItems_Itemadd(ByVal Item As Object)
Dim mycopiedappt As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Item.BillingInformation = Item.LastModificationTime
MsgBox Item.BillingInformation
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")
Set mycopiedappt = Item.Copy
MsgBox mycopiedappt.BillingInformation
mycopiedappt.Move OPalmFolder
End Sub

Private Sub CalendarItems_Itemchange(ByVal Item As Object)
Dim mychgappt As Outlook.AppointmentItem
Dim OCalItem As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Dim OStr As String
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")

OStr = "[BillingInformation]=" & Item.BillingInformation
'(here the item.billinginformation data returns blank or ""
Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)

If TypeName(OCalItem) "Nothing" Then
OCalItem.Delete
Set mychgappt = Item.Copy
mychgappt.Move OPalmFolder
Else
MsgBox "Can´t find corresponding appointment"
End If
End Sub


  #4  
Old August 7th 06, 07:46 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default BillingInformation field

Am Sat, 5 Aug 2006 16:25:01 -0700 schrieb Juan J:

Did you try an Item.Save?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Thanks for the tip,
the problem is that the object has a "" value (if I do a msgbox to the
Item.BillingInformation sentence, it prints an empty box) For some reason

the
recorded value in the field gets erased.
Thanks




"Michael Bauer [MVP - Outlook]" escribió:

Am Fri, 4 Aug 2006 11:04:02 -0700 schrieb Juan J:

Instead:

Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)


This change should do it:

.....Find("[BillingInformation]='" & Item.BillingInformation & "'")

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


Hi
I have some code that copies an appointment from one calendar to another

(a
different PST ) and it works fine when you create that appointment. What

I
need to do now is to reflect changes in the original appointment into

the
second one, but I need to make sure that no matter what is changed in

the
appointment, the "find" method still can find the copy of the

appointment.
For example I can´t do the search based in date, subject or status since

I
can´t trap the event before the change has taken place so the "find"

method
would fail to find the record in the second calendar. To do this I used

the
billinginformation field to put some data that would identify both the
original and the copied record. The problem is that the code seems to

write
the information in the field of both appointments but when I retrieve

the
field of the changed appointment it is shown in blank (no data in it) so

the
find method fails. Anybody knows why the value is not kept in the field?
Thanks.
Attached you will find the coding
Dim myOlApp As New Outlook.Application
Public WithEvents CalendarItems As Outlook.Items

Public Sub Initialize_handler()
Set CalendarItems =
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFo lderCalendar).Items
End Sub

Private Sub Application_Startup()
Initialize_handler
End Sub

Private Sub CalendarItems_Itemadd(ByVal Item As Object)
Dim mycopiedappt As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Item.BillingInformation = Item.LastModificationTime
MsgBox Item.BillingInformation
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")
Set mycopiedappt = Item.Copy
MsgBox mycopiedappt.BillingInformation
mycopiedappt.Move OPalmFolder
End Sub

Private Sub CalendarItems_Itemchange(ByVal Item As Object)
Dim mychgappt As Outlook.AppointmentItem
Dim OCalItem As Outlook.AppointmentItem
Dim PalmFolder As Outlook.Folders
Dim OPalmFolder As Outlook.MAPIFolder
Dim OStr As String
Set OPalmFolder =
myOlApp.GetNamespace("MAPI").Folders.Item("PALM_Re spaldo")
Set PalmFolder = OPalmFolder.Folders
Set OPalmFolder = PalmFolder.Item("Calendar(PALM)")

OStr = "[BillingInformation]=" & Item.BillingInformation
'(here the item.billinginformation data returns blank or ""
Set OCalItem = OPalmFolder.Items.Find("[BillingInformation]=" &
Item.BillingInformation)

If TypeName(OCalItem) "Nothing" Then
OCalItem.Delete
Set mychgappt = Item.Copy
mychgappt.Move OPalmFolder
Else
MsgBox "Can´t find corresponding appointment"
End If
End Sub


 




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
How can I export Notes field from Contact records in one field? Deb Outlook - Using Contacts 4 August 28th 06 09:12 PM
move phone numbers from company field to business field Tyson Outlook and VBA 3 June 9th 06 06:38 PM
Adding Follow Up field to Field Chooser Programatically. c Outlook and VBA 3 February 25th 06 03:10 PM
Populate Company field from Contact field in custom task form Sue Mosher [MVP-Outlook] Outlook - Using Forms 0 January 20th 06 08:37 PM
rename 'User Field 1' field ? E-Double Outlook - Installation 1 January 16th 06 04:38 PM


All times are GMT +1. The time now is 06:01 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.