Upgrade from 2003 to 2007

Status
Not open for further replies.
J

JP Ronse

Hi All,

I just made the upgrade from Office 2003 to 2007 and, oh thanks to Bill, a

lot of VBA-code is not working anymore.

Let me first explain the context, I have an Exvel workbook containing all

teammembers with their daily schedule (they are working 24/24 -7/7). I build

some code in Excel to create tasks or meetingrequests to assign tasks to my

team.

The purpose of the meetingrequests is not that I want to see them but to

inform them that they have a special task to do or to follow up. Therefore,

I don't want to see it in my calendar. So, I created a second calendar and

move the appointment to this one, using the code below.

Since the upgrade, it is still working, but I can't send the meetingrequest

anymore. Any help will be very appreciated.

With kind regards,

JP

Public WithEvents myAppointments As Outlook.Items

Private Sub Application_Startup()

Set myAppointments =

Outlook.Session.GetDefaultFolder(olFolderCalendar).Items

End Sub

Private Sub myAppointments_ItemAdd(ByVal Item As Object)

Dim MyItem As AppointmentItem

Dim blnPlanning As Boolean

Dim strSubject As String

Dim intRecipients As Integer

Dim varEntryID As Variant

Dim fldPlanningCalendar As Outlook.MAPIFolder

Dim MyPlanningItem As String

'''Stop

strSubject = "*Resource Reservation*"

'''blnPlanning = False

Set MyItem = Item

MyItem.Recipients.ResolveAll

On Error GoTo Error_myPlanningAppointments

Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote

Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

''' Planning Calendar exist

''' check item

If MyItem.Subject Like strSubject Then

blnPlanning = True

Else

blnPlanning = False

End If

'''MyItem.BusyStatus = olBusy

'''blnPlanning = True ''' means that meeting can be moved to planning

calendar

For intRecipients = 1 To MyItem.Recipients.Count

If MyItem.Recipients(intRecipients) Like "Jean-Pierre Degroote" Or

MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or

MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then

blnPlanning = False

Exit For

End If

Next intRecipients

If MyItem.Recipients.Count = 0 Then blnPlanning = False

If blnPlanning = True Then

With MyItem

''''.ReminderSet = False

> ResponseRequested = False

> Move fldPlanningCalendar

> Close olDiscard

End With

End If

If blnPlanning = True Then

Set MyItem = fldPlanningCalendar.Items.GetLast

MyItem.Display

End If

Exit_myPlanningAppointments:

On Error GoTo 0

Exit Sub

Error_myPlanningAppointments:

Select Case Err.Number

Case -2147221233

If MyItem.Subject Like strSubject Then

'''For intRecipients = 1 To MyItem.Recipients.Count

''' If MyItem.Organizer =

MyItem.Recipients(intRecipients) Then

''' MyItem.BusyStatus = olBusy

''' Exit For

''' Else

''' MyItem.BusyStatus = olFree

''' Exit For

''' End If

'''Next intRecipients

blnPlanning = True

If blnPlanning = True Then

MyItem.BusyStatus = olFree

End If

End If

'''MyItem.Display

Set MyItem = Nothing

Resume Exit_myPlanningAppointments:

Case Else

MsgBox prompt:="An error occured.", Title:="Warning",

Buttons:=vbOKOnly

Resume Exit_myPlanningAppointments

End Select

End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
What's the error message, and where does it occur?

Best regards

Michael Bauer

Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:


> Hi All,

> I just made the upgrade from Office 2003 to 2007 and, oh thanks to Bill, a
> lot of VBA-code is not working anymore.

> Let me first explain the context, I have an Exvel workbook containing all
> teammembers with their daily schedule (they are working 24/24 -7/7). I


build
> some code in Excel to create tasks or meetingrequests to assign tasks to


my
> team.

> The purpose of the meetingrequests is not that I want to see them but to
> inform them that they have a special task to do or to follow up.


Therefore,
> I don't want to see it in my calendar. So, I created a second calendar and
> move the appointment to this one, using the code below.

> Since the upgrade, it is still working, but I can't send the


meetingrequest
> anymore. Any help will be very appreciated.

> With kind regards,

> JP

> Public WithEvents myAppointments As Outlook.Items

> Private Sub Application_Startup()
> Set myAppointments =
> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> End Sub

> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> Dim MyItem As AppointmentItem
> Dim blnPlanning As Boolean
> Dim strSubject As String
> Dim intRecipients As Integer
> Dim varEntryID As Variant
> Dim fldPlanningCalendar As Outlook.MAPIFolder
> Dim MyPlanningItem As String

> '''Stop
> strSubject = "*Resource Reservation*"
> '''blnPlanning = False

> Set MyItem = Item
> MyItem.Recipients.ResolveAll
> On Error GoTo Error_myPlanningAppointments

> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote
> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

> ''' Planning Calendar exist
> ''' check item
> If MyItem.Subject Like strSubject Then
> blnPlanning = True
> Else
> blnPlanning = False
> End If
> '''MyItem.BusyStatus = olBusy

> '''blnPlanning = True ''' means that meeting can be moved to planning
> calendar
> For intRecipients = 1 To MyItem.Recipients.Count
> If MyItem.Recipients(intRecipients) Like "Jean-Pierre Degroote" Or
> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> blnPlanning = False
> Exit For
> End If
> Next intRecipients

> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> If blnPlanning = True Then
> With MyItem
> ''''.ReminderSet = False
> .ResponseRequested = False
> .Move fldPlanningCalendar
> .Close olDiscard
> End With
> End If

> If blnPlanning = True Then
> Set MyItem = fldPlanningCalendar.Items.GetLast
> MyItem.Display
> End If

> Exit_myPlanningAppointments:

> On Error GoTo 0
> Exit Sub

> Error_myPlanningAppointments:
> Select Case Err.Number
> Case -2147221233
> If MyItem.Subject Like strSubject Then
> '''For intRecipients = 1 To MyItem.Recipients.Count
> ''' If MyItem.Organizer =
> MyItem.Recipients(intRecipients) Then
> ''' MyItem.BusyStatus = olBusy
> ''' Exit For
> ''' Else
> ''' MyItem.BusyStatus = olFree
> ''' Exit For
> ''' End If
> '''Next intRecipients
> blnPlanning = True
> If blnPlanning = True Then
> MyItem.BusyStatus = olFree
> End If
> End If
> '''MyItem.Display
> Set MyItem = Nothing
> Resume Exit_myPlanningAppointments:
> Case Else
> MsgBox prompt:="An error occured.", Title:="Warning",
> Buttons:=vbOKOnly
> Resume Exit_myPlanningAppointments
> End Select
> End Sub
 
J

JP Ronse

Hi Michael,

I got the error that the item was deleted (after the .move instruction), the

test of this evening doesn't show this error anymore??? (During the weekend

I was testing on-line, now off-line, perhaps this can make a difference?)

The issue that I still have, is that the planning calendar has a copy of the

original and that I do not longer have the possibility to send the meeting

request. I have really to send out the requests so that the involved

employees are aware of it. But there is no need to keep all these requests

in my calendar. Therefore, the checks to decide to keep it or to move it.

I cannot use .send because I must be able to edit the message or add

additional info before sending.

In Outlook 2003, the code below allowed to send the meeting request.

Does the .move insruction has now extra parameters to indicate a copy or a

move?

With kind regards,

JP

"Michael Bauer " <mb@mvps.org> wrote in message

news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...

> What's the error message, and where does it occur?

> > Best regards
> Michael Bauer
>

>

> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
>
> > Hi All,
>

>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to Bill,
> > a
> > lot of VBA-code is not working anymore.
>

>> Let me first explain the context, I have an Exvel workbook containing all
> > teammembers with their daily schedule (they are working 24/24 -7/7). I

> build
> > some code in Excel to create tasks or meetingrequests to assign tasks to

> my
> > team.
>

>> The purpose of the meetingrequests is not that I want to see them but to
> > inform them that they have a special task to do or to follow up.

> Therefore,
> > I don't want to see it in my calendar. So, I created a second calendar
> > and
> > move the appointment to this one, using the code below.
>

>> Since the upgrade, it is still working, but I can't send the

> meetingrequest
> > anymore. Any help will be very appreciated.
>

>> With kind regards,
>

>> JP
>

>
>
>
>> Public WithEvents myAppointments As Outlook.Items
>

>> Private Sub Application_Startup()
> > Set myAppointments =
> > Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> > End Sub
>

>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> > Dim MyItem As AppointmentItem
> > Dim blnPlanning As Boolean
> > Dim strSubject As String
> > Dim intRecipients As Integer
> > Dim varEntryID As Variant
> > Dim fldPlanningCalendar As Outlook.MAPIFolder
> > Dim MyPlanningItem As String
>

>> '''Stop
> > strSubject = "*Resource Reservation*"
> > '''blnPlanning = False
>

>> Set MyItem = Item
> > MyItem.Recipients.ResolveAll
> > On Error GoTo Error_myPlanningAppointments
>

>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote
> > Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
>

>> ''' Planning Calendar exist
> > ''' check item
> > If MyItem.Subject Like strSubject Then
> > blnPlanning = True
> > Else
> > blnPlanning = False
> > End If
> > '''MyItem.BusyStatus = olBusy
>

>> '''blnPlanning = True ''' means that meeting can be moved to planning
> > calendar
> > For intRecipients = 1 To MyItem.Recipients.Count
> > If MyItem.Recipients(intRecipients) Like "Jean-Pierre Degroote"
> > Or
> > MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> > MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> > blnPlanning = False
> > Exit For
> > End If
> > Next intRecipients
>

>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> > If blnPlanning = True Then
> > With MyItem
> > ''''.ReminderSet = False
> > .ResponseRequested = False
> > .Move fldPlanningCalendar
> > .Close olDiscard
> > End With
> > End If
>

>> If blnPlanning = True Then
> > Set MyItem = fldPlanningCalendar.Items.GetLast
> > MyItem.Display
> > End If
>

>> Exit_myPlanningAppointments:
>

>> On Error GoTo 0
> > Exit Sub
>

>> Error_myPlanningAppointments:
> > Select Case Err.Number
> > Case -2147221233
> > If MyItem.Subject Like strSubject Then
> > '''For intRecipients = 1 To MyItem.Recipients.Count
> > ''' If MyItem.Organizer =
> > MyItem.Recipients(intRecipients) Then
> > ''' MyItem.BusyStatus = olBusy
> > ''' Exit For
> > ''' Else
> > ''' MyItem.BusyStatus = olFree
> > ''' Exit For
> > ''' End If
> > '''Next intRecipients
> > blnPlanning = True
> > If blnPlanning = True Then
> > MyItem.BusyStatus = olFree
> > End If
> > End If
> > '''MyItem.Display
> > Set MyItem = Nothing
> > Resume Exit_myPlanningAppointments:
> > Case Else
> > MsgBox prompt:="An error occured.", Title:="Warning",
> > Buttons:=vbOKOnly
> > Resume Exit_myPlanningAppointments
> > End Select
> > End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
It's hard for me to follow what your question is. However, as to your code:

Assuming the item is open, I'd first close and then move it. The Move

function returns the moved item, so there's no need to work with the GetLast

function.

If the moved item isn't displayed, the should be an error. Your error

handler is quite meaningless for the Else case. I'd add Err.Description to

the prompt, so that you know which error occurs.

Best regards

Michael Bauer

Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:


> Hi Michael,

> I got the error that the item was deleted (after the .move instruction),


the
> test of this evening doesn't show this error anymore??? (During the


weekend
> I was testing on-line, now off-line, perhaps this can make a difference?)

> The issue that I still have, is that the planning calendar has a copy of


the
> original and that I do not longer have the possibility to send the meeting
> request. I have really to send out the requests so that the involved
> employees are aware of it. But there is no need to keep all these requests
> in my calendar. Therefore, the checks to decide to keep it or to move it.

> I cannot use .send because I must be able to edit the message or add
> additional info before sending.

> In Outlook 2003, the code below allowed to send the meeting request.

> Does the .move insruction has now extra parameters to indicate a copy or a
> move?

> With kind regards,

> JP

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
>

>> What's the error message, and where does it occur?
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >
> >> Hi All,
> >
>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to Bill,
> >> a
> >> lot of VBA-code is not working anymore.
> >
>>> Let me first explain the context, I have an Exvel workbook containing


all
> >> teammembers with their daily schedule (they are working 24/24 -7/7). I

> > build
> >> some code in Excel to create tasks or meetingrequests to assign tasks


to
> > my
> >> team.
> >
>>> The purpose of the meetingrequests is not that I want to see them but to
> >> inform them that they have a special task to do or to follow up.

> > Therefore,
> >> I don't want to see it in my calendar. So, I created a second calendar
> >> and
> >> move the appointment to this one, using the code below.
> >
>>> Since the upgrade, it is still working, but I can't send the

> > meetingrequest
> >> anymore. Any help will be very appreciated.
> >
>>> With kind regards,
> >
>>> JP
> >
>>
>>
>>
>>> Public WithEvents myAppointments As Outlook.Items
> >
>>> Private Sub Application_Startup()
> >> Set myAppointments =
> >> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >> End Sub
> >
>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >> Dim MyItem As AppointmentItem
> >> Dim blnPlanning As Boolean
> >> Dim strSubject As String
> >> Dim intRecipients As Integer
> >> Dim varEntryID As Variant
> >> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >> Dim MyPlanningItem As String
> >
>>> '''Stop
> >> strSubject = "*Resource Reservation*"
> >> '''blnPlanning = False
> >
>>> Set MyItem = Item
> >> MyItem.Recipients.ResolveAll
> >> On Error GoTo Error_myPlanningAppointments
> >
>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -


Degroote
> >> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >
>>> ''' Planning Calendar exist
> >> ''' check item
> >> If MyItem.Subject Like strSubject Then
> >> blnPlanning = True
> >> Else
> >> blnPlanning = False
> >> End If
> >> '''MyItem.BusyStatus = olBusy
> >
>>> '''blnPlanning = True ''' means that meeting can be moved to


planning
> >> calendar
> >> For intRecipients = 1 To MyItem.Recipients.Count
> >> If MyItem.Recipients(intRecipients) Like "Jean-Pierre Degroote"
> >> Or
> >> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >> blnPlanning = False
> >> Exit For
> >> End If
> >> Next intRecipients
> >
>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >> If blnPlanning = True Then
> >> With MyItem
> >> ''''.ReminderSet = False
> >> .ResponseRequested = False
> >> .Move fldPlanningCalendar
> >> .Close olDiscard
> >> End With
> >> End If
> >
>>> If blnPlanning = True Then
> >> Set MyItem = fldPlanningCalendar.Items.GetLast
> >> MyItem.Display
> >> End If
> >
>>> Exit_myPlanningAppointments:
> >
>>> On Error GoTo 0
> >> Exit Sub
> >
>>> Error_myPlanningAppointments:
> >> Select Case Err.Number
> >> Case -2147221233
> >> If MyItem.Subject Like strSubject Then
> >> '''For intRecipients = 1 To MyItem.Recipients.Count
> >> ''' If MyItem.Organizer =
> >> MyItem.Recipients(intRecipients) Then
> >> ''' MyItem.BusyStatus = olBusy
> >> ''' Exit For
> >> ''' Else
> >> ''' MyItem.BusyStatus = olFree
> >> ''' Exit For
> >> ''' End If
> >> '''Next intRecipients
> >> blnPlanning = True
> >> If blnPlanning = True Then
> >> MyItem.BusyStatus = olFree
> >> End If
> >> End If
> >> '''MyItem.Display
> >> Set MyItem = Nothing
> >> Resume Exit_myPlanningAppointments:
> >> Case Else
> >> MsgBox prompt:="An error occured.", Title:="Warning",
> >> Buttons:=vbOKOnly
> >> Resume Exit_myPlanningAppointments
> >> End Select
> >> End Sub
 
J

JP Ronse

Hi Michael,

My problem is with the following code lines:

Creating a meeting request fires the ItemAdd event

If blnPlanning = True Then

With MyItem

''''.ReminderSet = False

> ResponseRequested = False

> Move fldPlanningCalendar

> Close olDiscard

End With

End If

If blnPlanning = True Then

Set MyItem = fldPlanningCalendar.Items.GetLast

MyItem.Display

End If

With blnPlanning I find out if I want to keep this meeting request in my own

calendar or not. What was working in Outlook 2003 is moving the item to the

other calendar but because I still had to send it, it recalled it form the

other calendar with .GetLast.

In outlook 2007, the moved item is a copy of the original and so I cannot

send it anymore to the recipients.

A workaround could be sending and closing the item first and move it them as

you suggest.

Is there an ItemClose event and is it fired by sending the request?

Many, many thanks for your time and assistance.

With kind regards,

JP

"Michael Bauer " <mb@mvps.org> wrote in message

news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...

> It's hard for me to follow what your question is. However, as to your
> code:
> Assuming the item is open, I'd first close and then move it. The Move
> function returns the moved item, so there's no need to work with the
> GetLast
> function.

> If the moved item isn't displayed, the should be an error. Your error
> handler is quite meaningless for the Else case. I'd add Err.Description to
> the prompt, so that you know which error occurs.

> > Best regards
> Michael Bauer
>

>

> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
>
> > Hi Michael,
>

>> I got the error that the item was deleted (after the .move instruction),

> the
> > test of this evening doesn't show this error anymore??? (During the

> weekend
> > I was testing on-line, now off-line, perhaps this can make a difference?)
>

>> The issue that I still have, is that the planning calendar has a copy of

> the
> > original and that I do not longer have the possibility to send the
> > meeting
> > request. I have really to send out the requests so that the involved
> > employees are aware of it. But there is no need to keep all these
> > requests
> > in my calendar. Therefore, the checks to decide to keep it or to move it.
>

>> I cannot use .send because I must be able to edit the message or add
> > additional info before sending.
>

>> In Outlook 2003, the code below allowed to send the meeting request.
>

>> Does the .move insruction has now extra parameters to indicate a copy or
> > a
> > move?
>

>> With kind regards,
>

>> JP
>

>> "Michael Bauer " <mb@mvps.org> wrote in message
> > news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >
>>> What's the error message, and where does it occur?
> >
>>> > >> Best regards
> >> Michael Bauer
> >>

> >>

>>
>>
>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >
>>>> Hi All,
> >>
>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>> Bill,
> >>> a
> >>> lot of VBA-code is not working anymore.
> >>
>>>> Let me first explain the context, I have an Exvel workbook containing

> all
> >>> teammembers with their daily schedule (they are working 24/24 -7/7). I
> >> build
> >>> some code in Excel to create tasks or meetingrequests to assign tasks

> to
> >> my
> >>> team.
> >>
>>>> The purpose of the meetingrequests is not that I want to see them but
> >>> to
> >>> inform them that they have a special task to do or to follow up.
> >> Therefore,
> >>> I don't want to see it in my calendar. So, I created a second calendar
> >>> and
> >>> move the appointment to this one, using the code below.
> >>
>>>> Since the upgrade, it is still working, but I can't send the
> >> meetingrequest
> >>> anymore. Any help will be very appreciated.
> >>
>>>> With kind regards,
> >>
>>>> JP
> >>
>>>
>>>
>>>
>>>> Public WithEvents myAppointments As Outlook.Items
> >>
>>>> Private Sub Application_Startup()
> >>> Set myAppointments =
> >>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>> End Sub
> >>
>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>> Dim MyItem As AppointmentItem
> >>> Dim blnPlanning As Boolean
> >>> Dim strSubject As String
> >>> Dim intRecipients As Integer
> >>> Dim varEntryID As Variant
> >>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>> Dim MyPlanningItem As String
> >>
>>>> '''Stop
> >>> strSubject = "*Resource Reservation*"
> >>> '''blnPlanning = False
> >>
>>>> Set MyItem = Item
> >>> MyItem.Recipients.ResolveAll
> >>> On Error GoTo Error_myPlanningAppointments
> >>
>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -

> Degroote
> >>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>
>>>> ''' Planning Calendar exist
> >>> ''' check item
> >>> If MyItem.Subject Like strSubject Then
> >>> blnPlanning = True
> >>> Else
> >>> blnPlanning = False
> >>> End If
> >>> '''MyItem.BusyStatus = olBusy
> >>
>>>> '''blnPlanning = True ''' means that meeting can be moved to

> planning
> >>> calendar
> >>> For intRecipients = 1 To MyItem.Recipients.Count
> >>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre Degroote"
> >>> Or
> >>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>> blnPlanning = False
> >>> Exit For
> >>> End If
> >>> Next intRecipients
> >>
>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>> If blnPlanning = True Then
> >>> With MyItem
> >>> ''''.ReminderSet = False
> >>> .ResponseRequested = False
> >>> .Move fldPlanningCalendar
> >>> .Close olDiscard
> >>> End With
> >>> End If
> >>
>>>> If blnPlanning = True Then
> >>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>> MyItem.Display
> >>> End If
> >>
>>>> Exit_myPlanningAppointments:
> >>
>>>> On Error GoTo 0
> >>> Exit Sub
> >>
>>>> Error_myPlanningAppointments:
> >>> Select Case Err.Number
> >>> Case -2147221233
> >>> If MyItem.Subject Like strSubject Then
> >>> '''For intRecipients = 1 To MyItem.Recipients.Count
> >>> ''' If MyItem.Organizer =
> >>> MyItem.Recipients(intRecipients) Then
> >>> ''' MyItem.BusyStatus = olBusy
> >>> ''' Exit For
> >>> ''' Else
> >>> ''' MyItem.BusyStatus = olFree
> >>> ''' Exit For
> >>> ''' End If
> >>> '''Next intRecipients
> >>> blnPlanning = True
> >>> If blnPlanning = True Then
> >>> MyItem.BusyStatus = olFree
> >>> End If
> >>> End If
> >>> '''MyItem.Display
> >>> Set MyItem = Nothing
> >>> Resume Exit_myPlanningAppointments:
> >>> Case Else
> >>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>> Buttons:=vbOKOnly
> >>> Resume Exit_myPlanningAppointments
> >>> End Select
> >>> End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
You can see all of the available events in the object browser (f2), there's

also a Close event. But as I see it, you don't need that. Please try my

suggestion:

myitem.close oldiscard

DoEvents

set myitem=myitem.move(whereever)

myitem.display

If the item doesn't get displayed, there must be an error, which you have to

catch in your error handler.

Best regards

Michael Bauer

Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:


> Hi Michael,

> My problem is with the following code lines:

> Creating a meeting request fires the ItemAdd event

> If blnPlanning = True Then
> With MyItem
> ''''.ReminderSet = False
> .ResponseRequested = False
> .Move fldPlanningCalendar
> .Close olDiscard
> End With
> End If

> If blnPlanning = True Then
> Set MyItem = fldPlanningCalendar.Items.GetLast
> MyItem.Display
> End If

> With blnPlanning I find out if I want to keep this meeting request in my


own
> calendar or not. What was working in Outlook 2003 is moving the item to


the
> other calendar but because I still had to send it, it recalled it form the
> other calendar with .GetLast.

> In outlook 2007, the moved item is a copy of the original and so I cannot
> send it anymore to the recipients.

> A workaround could be sending and closing the item first and move it them


as
> you suggest.

> Is there an ItemClose event and is it fired by sending the request?

> Many, many thanks for your time and assistance.

> With kind regards,

> JP

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
>

>
>> It's hard for me to follow what your question is. However, as to your
> > code:
> > Assuming the item is open, I'd first close and then move it. The Move
> > function returns the moved item, so there's no need to work with the
> > GetLast
> > function.
>

>> If the moved item isn't displayed, the should be an error. Your error
> > handler is quite meaningless for the Else case. I'd add Err.Description


to
> > the prompt, so that you know which error occurs.
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >
> >> Hi Michael,
> >
>>> I got the error that the item was deleted (after the .move instruction),

> > the
> >> test of this evening doesn't show this error anymore??? (During the

> > weekend
> >> I was testing on-line, now off-line, perhaps this can make a


difference?)
> >
>>> The issue that I still have, is that the planning calendar has a copy of

> > the
> >> original and that I do not longer have the possibility to send the
> >> meeting
> >> request. I have really to send out the requests so that the involved
> >> employees are aware of it. But there is no need to keep all these
> >> requests
> >> in my calendar. Therefore, the checks to decide to keep it or to move


it.
> >
>>> I cannot use .send because I must be able to edit the message or add
> >> additional info before sending.
> >
>>> In Outlook 2003, the code below allowed to send the meeting request.
> >
>>> Does the .move insruction has now extra parameters to indicate a copy or
> >> a
> >> move?
> >
>>> With kind regards,
> >
>>> JP
> >
>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>
>>>> What's the error message, and where does it occur?
> >>
>>>> > >>> Best regards
> >>> Michael Bauer
> >>>

> >>>

>>>
>>>
>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>
>>>>> Hi All,
> >>>
>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>>> Bill,
> >>>> a
> >>>> lot of VBA-code is not working anymore.
> >>>
>>>>> Let me first explain the context, I have an Exvel workbook containing

> > all
> >>>> teammembers with their daily schedule (they are working 24/24 -7/7). I
> >>> build
> >>>> some code in Excel to create tasks or meetingrequests to assign tasks

> > to
> >>> my
> >>>> team.
> >>>
>>>>> The purpose of the meetingrequests is not that I want to see them but
> >>>> to
> >>>> inform them that they have a special task to do or to follow up.
> >>> Therefore,
> >>>> I don't want to see it in my calendar. So, I created a second calendar
> >>>> and
> >>>> move the appointment to this one, using the code below.
> >>>
>>>>> Since the upgrade, it is still working, but I can't send the
> >>> meetingrequest
> >>>> anymore. Any help will be very appreciated.
> >>>
>>>>> With kind regards,
> >>>
>>>>> JP
> >>>
>>>>
>>>>
>>>>
>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>
>>>>> Private Sub Application_Startup()
> >>>> Set myAppointments =
> >>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>> End Sub
> >>>
>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>> Dim MyItem As AppointmentItem
> >>>> Dim blnPlanning As Boolean
> >>>> Dim strSubject As String
> >>>> Dim intRecipients As Integer
> >>>> Dim varEntryID As Variant
> >>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>> Dim MyPlanningItem As String
> >>>
>>>>> '''Stop
> >>>> strSubject = "*Resource Reservation*"
> >>>> '''blnPlanning = False
> >>>
>>>>> Set MyItem = Item
> >>>> MyItem.Recipients.ResolveAll
> >>>> On Error GoTo Error_myPlanningAppointments
> >>>
>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -

> > Degroote
> >>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>
>>>>> ''' Planning Calendar exist
> >>>> ''' check item
> >>>> If MyItem.Subject Like strSubject Then
> >>>> blnPlanning = True
> >>>> Else
> >>>> blnPlanning = False
> >>>> End If
> >>>> '''MyItem.BusyStatus = olBusy
> >>>
>>>>> '''blnPlanning = True ''' means that meeting can be moved to

> > planning
> >>>> calendar
> >>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre


Degroote"
> >>>> Or
> >>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>>> blnPlanning = False
> >>>> Exit For
> >>>> End If
> >>>> Next intRecipients
> >>>
>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>> If blnPlanning = True Then
> >>>> With MyItem
> >>>> ''''.ReminderSet = False
> >>>> .ResponseRequested = False
> >>>> .Move fldPlanningCalendar
> >>>> .Close olDiscard
> >>>> End With
> >>>> End If
> >>>
>>>>> If blnPlanning = True Then
> >>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>> MyItem.Display
> >>>> End If
> >>>
>>>>> Exit_myPlanningAppointments:
> >>>
>>>>> On Error GoTo 0
> >>>> Exit Sub
> >>>
>>>>> Error_myPlanningAppointments:
> >>>> Select Case Err.Number
> >>>> Case -2147221233
> >>>> If MyItem.Subject Like strSubject Then
> >>>> '''For intRecipients = 1 To MyItem.Recipients.Count
> >>>> ''' If MyItem.Organizer =
> >>>> MyItem.Recipients(intRecipients) Then
> >>>> ''' MyItem.BusyStatus = olBusy
> >>>> ''' Exit For
> >>>> ''' Else
> >>>> ''' MyItem.BusyStatus = olFree
> >>>> ''' Exit For
> >>>> ''' End If
> >>>> '''Next intRecipients
> >>>> blnPlanning = True
> >>>> If blnPlanning = True Then
> >>>> MyItem.BusyStatus = olFree
> >>>> End If
> >>>> End If
> >>>> '''MyItem.Display
> >>>> Set MyItem = Nothing
> >>>> Resume Exit_myPlanningAppointments:
> >>>> Case Else
> >>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>> Buttons:=vbOKOnly
> >>>> Resume Exit_myPlanningAppointments
> >>>> End Select
> >>>> End Sub
 
J

JP Ronse

Hi Michael,

Thanks for your input, I'll try your suggestion this weekend and keep you

posted about the result.

With kind regards,

JP

"Michael Bauer " <mb@mvps.org> wrote in message

news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...

> You can see all of the available events in the object browser (f2),
> there's
> also a Close event. But as I see it, you don't need that. Please try my
> suggestion:

> myitem.close oldiscard
> DoEvents
> set myitem=myitem.move(whereever)
> myitem.display

> If the item doesn't get displayed, there must be an error, which you have
> to
> catch in your error handler.

> > Best regards
> Michael Bauer
>

>

> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
>
> > Hi Michael,
>

>> My problem is with the following code lines:
>

>> Creating a meeting request fires the ItemAdd event
>

>> If blnPlanning = True Then
> > With MyItem
> > ''''.ReminderSet = False
> > .ResponseRequested = False
> > .Move fldPlanningCalendar
> > .Close olDiscard
> > End With
> > End If
>

>> If blnPlanning = True Then
> > Set MyItem = fldPlanningCalendar.Items.GetLast
> > MyItem.Display
> > End If
>

>> With blnPlanning I find out if I want to keep this meeting request in my

> own
> > calendar or not. What was working in Outlook 2003 is moving the item to

> the
> > other calendar but because I still had to send it, it recalled it form
> > the
> > other calendar with .GetLast.
>

>> In outlook 2007, the moved item is a copy of the original and so I cannot
> > send it anymore to the recipients.
>

>> A workaround could be sending and closing the item first and move it them

> as
> > you suggest.
>

>> Is there an ItemClose event and is it fired by sending the request?
>

>> Many, many thanks for your time and assistance.
>

>> With kind regards,
>

>> JP
>

>
>> "Michael Bauer " <mb@mvps.org> wrote in message
> > news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >
>>
>>> It's hard for me to follow what your question is. However, as to your
> >> code:
> >> Assuming the item is open, I'd first close and then move it. The Move
> >> function returns the moved item, so there's no need to work with the
> >> GetLast
> >> function.
> >
>>> If the moved item isn't displayed, the should be an error. Your error
> >> handler is quite meaningless for the Else case. I'd add Err.Description

> to
> >> the prompt, so that you know which error occurs.
> >
>>> > >> Best regards
> >> Michael Bauer
> >>

> >>

>>
>>
>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >
>>>> Hi Michael,
> >>
>>>> I got the error that the item was deleted (after the .move
> >>> instruction),
> >> the
> >>> test of this evening doesn't show this error anymore??? (During the
> >> weekend
> >>> I was testing on-line, now off-line, perhaps this can make a

> difference?)
> >>
>>>> The issue that I still have, is that the planning calendar has a copy
> >>> of
> >> the
> >>> original and that I do not longer have the possibility to send the
> >>> meeting
> >>> request. I have really to send out the requests so that the involved
> >>> employees are aware of it. But there is no need to keep all these
> >>> requests
> >>> in my calendar. Therefore, the checks to decide to keep it or to move

> it.
> >>
>>>> I cannot use .send because I must be able to edit the message or add
> >>> additional info before sending.
> >>
>>>> In Outlook 2003, the code below allowed to send the meeting request.
> >>
>>>> Does the .move insruction has now extra parameters to indicate a copy
> >>> or
> >>> a
> >>> move?
> >>
>>>> With kind regards,
> >>
>>>> JP
> >>
>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>
>>>>> What's the error message, and where does it occur?
> >>>
>>>>> > >>>> Best regards
> >>>> Michael Bauer
> >>>>

> >>>>

>>>>
>>>>
>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>
>>>>>> Hi All,
> >>>>
>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>>>> Bill,
> >>>>> a
> >>>>> lot of VBA-code is not working anymore.
> >>>>
>>>>>> Let me first explain the context, I have an Exvel workbook containing
> >> all
> >>>>> teammembers with their daily schedule (they are working 24/24 -7/7).
> >>>>> I
> >>>> build
> >>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>> tasks
> >> to
> >>>> my
> >>>>> team.
> >>>>
>>>>>> The purpose of the meetingrequests is not that I want to see them but
> >>>>> to
> >>>>> inform them that they have a special task to do or to follow up.
> >>>> Therefore,
> >>>>> I don't want to see it in my calendar. So, I created a second
> >>>>> calendar
> >>>>> and
> >>>>> move the appointment to this one, using the code below.
> >>>>
>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>> meetingrequest
> >>>>> anymore. Any help will be very appreciated.
> >>>>
>>>>>> With kind regards,
> >>>>
>>>>>> JP
> >>>>
>>>>>
>>>>>
>>>>>
>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>
>>>>>> Private Sub Application_Startup()
> >>>>> Set myAppointments =
> >>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>> End Sub
> >>>>
>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>> Dim MyItem As AppointmentItem
> >>>>> Dim blnPlanning As Boolean
> >>>>> Dim strSubject As String
> >>>>> Dim intRecipients As Integer
> >>>>> Dim varEntryID As Variant
> >>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>> Dim MyPlanningItem As String
> >>>>
>>>>>> '''Stop
> >>>>> strSubject = "*Resource Reservation*"
> >>>>> '''blnPlanning = False
> >>>>
>>>>>> Set MyItem = Item
> >>>>> MyItem.Recipients.ResolveAll
> >>>>> On Error GoTo Error_myPlanningAppointments
> >>>>
>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >> Degroote
> >>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>
>>>>>> ''' Planning Calendar exist
> >>>>> ''' check item
> >>>>> If MyItem.Subject Like strSubject Then
> >>>>> blnPlanning = True
> >>>>> Else
> >>>>> blnPlanning = False
> >>>>> End If
> >>>>> '''MyItem.BusyStatus = olBusy
> >>>>
>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >> planning
> >>>>> calendar
> >>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre

> Degroote"
> >>>>> Or
> >>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>>>> blnPlanning = False
> >>>>> Exit For
> >>>>> End If
> >>>>> Next intRecipients
> >>>>
>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>> If blnPlanning = True Then
> >>>>> With MyItem
> >>>>> ''''.ReminderSet = False
> >>>>> .ResponseRequested = False
> >>>>> .Move fldPlanningCalendar
> >>>>> .Close olDiscard
> >>>>> End With
> >>>>> End If
> >>>>
>>>>>> If blnPlanning = True Then
> >>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>> MyItem.Display
> >>>>> End If
> >>>>
>>>>>> Exit_myPlanningAppointments:
> >>>>
>>>>>> On Error GoTo 0
> >>>>> Exit Sub
> >>>>
>>>>>> Error_myPlanningAppointments:
> >>>>> Select Case Err.Number
> >>>>> Case -2147221233
> >>>>> If MyItem.Subject Like strSubject Then
> >>>>> '''For intRecipients = 1 To MyItem.Recipients.Count
> >>>>> ''' If MyItem.Organizer =
> >>>>> MyItem.Recipients(intRecipients) Then
> >>>>> ''' MyItem.BusyStatus = olBusy
> >>>>> ''' Exit For
> >>>>> ''' Else
> >>>>> ''' MyItem.BusyStatus = olFree
> >>>>> ''' Exit For
> >>>>> ''' End If
> >>>>> '''Next intRecipients
> >>>>> blnPlanning = True
> >>>>> If blnPlanning = True Then
> >>>>> MyItem.BusyStatus = olFree
> >>>>> End If
> >>>>> End If
> >>>>> '''MyItem.Display
> >>>>> Set MyItem = Nothing
> >>>>> Resume Exit_myPlanningAppointments:
> >>>>> Case Else
> >>>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>>> Buttons:=vbOKOnly
> >>>>> Resume Exit_myPlanningAppointments
> >>>>> End Select
> >>>>> End Sub
 
J

JP Ronse

Hi Michael,

It is not working like I want and I don't get it fixed.

The behaviour of Outlook 2007 differs from 2003. When dragging an

appointment to another calendar, Outlook 2007 makes a copy of the

appointment and keeps the original in the calendar. Furthermore it is not

possible to send the copy.

Witk kind regards,

JP

"JP Ronse" <fb893760@skynet.be> wrote in message

news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> Hi Michael,

> Thanks for your input, I'll try your suggestion this weekend and keep you
> posted about the result.

> With kind regards,

> JP

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
>

>
>> You can see all of the available events in the object browser (f2),
> > there's
> > also a Close event. But as I see it, you don't need that. Please try my
> > suggestion:
>

>> myitem.close oldiscard
> > DoEvents
> > set myitem=myitem.move(whereever)
> > myitem.display
>

>> If the item doesn't get displayed, there must be an error, which you have
> > to
> > catch in your error handler.
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >
> >> Hi Michael,
> >
>>> My problem is with the following code lines:
> >
>>> Creating a meeting request fires the ItemAdd event
> >
>>> If blnPlanning = True Then
> >> With MyItem
> >> ''''.ReminderSet = False
> >> .ResponseRequested = False
> >> .Move fldPlanningCalendar
> >> .Close olDiscard
> >> End With
> >> End If
> >
>>> If blnPlanning = True Then
> >> Set MyItem = fldPlanningCalendar.Items.GetLast
> >> MyItem.Display
> >> End If
> >
>>> With blnPlanning I find out if I want to keep this meeting request in my

> > own
> >> calendar or not. What was working in Outlook 2003 is moving the item to

> > the
> >> other calendar but because I still had to send it, it recalled it form
> >> the
> >> other calendar with .GetLast.
> >
>>> In outlook 2007, the moved item is a copy of the original and so I
> >> cannot
> >> send it anymore to the recipients.
> >
>>> A workaround could be sending and closing the item first and move it
> >> them

> > as
> >> you suggest.
> >
>>> Is there an ItemClose event and is it fired by sending the request?
> >
>>> Many, many thanks for your time and assistance.
> >
>>> With kind regards,
> >
>>> JP
> >
>>
>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>
>>>
>>>> It's hard for me to follow what your question is. However, as to your
> >>> code:
> >>> Assuming the item is open, I'd first close and then move it. The Move
> >>> function returns the moved item, so there's no need to work with the
> >>> GetLast
> >>> function.
> >>
>>>> If the moved item isn't displayed, the should be an error. Your error
> >>> handler is quite meaningless for the Else case. I'd add Err.Description

> > to
> >>> the prompt, so that you know which error occurs.
> >>
>>>> > >>> Best regards
> >>> Michael Bauer
> >>>

> >>>

>>>
>>>
>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>
>>>>> Hi Michael,
> >>>
>>>>> I got the error that the item was deleted (after the .move
> >>>> instruction),
> >>> the
> >>>> test of this evening doesn't show this error anymore??? (During the
> >>> weekend
> >>>> I was testing on-line, now off-line, perhaps this can make a

> > difference?)
> >>>
>>>>> The issue that I still have, is that the planning calendar has a copy
> >>>> of
> >>> the
> >>>> original and that I do not longer have the possibility to send the
> >>>> meeting
> >>>> request. I have really to send out the requests so that the involved
> >>>> employees are aware of it. But there is no need to keep all these
> >>>> requests
> >>>> in my calendar. Therefore, the checks to decide to keep it or to move

> > it.
> >>>
>>>>> I cannot use .send because I must be able to edit the message or add
> >>>> additional info before sending.
> >>>
>>>>> In Outlook 2003, the code below allowed to send the meeting request.
> >>>
>>>>> Does the .move insruction has now extra parameters to indicate a copy
> >>>> or
> >>>> a
> >>>> move?
> >>>
>>>>> With kind regards,
> >>>
>>>>> JP
> >>>
>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>
>>>>>> What's the error message, and where does it occur?
> >>>>
>>>>>> > >>>>> Best regards
> >>>>> Michael Bauer
> >>>>>

> >>>>>

>>>>>
>>>>>
>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>
>>>>>>> Hi All,
> >>>>>
>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>>>>> Bill,
> >>>>>> a
> >>>>>> lot of VBA-code is not working anymore.
> >>>>>
>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>> containing
> >>> all
> >>>>>> teammembers with their daily schedule (they are working 24/24 -7/7).
> >>>>>> I
> >>>>> build
> >>>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>>> tasks
> >>> to
> >>>>> my
> >>>>>> team.
> >>>>>
>>>>>>> The purpose of the meetingrequests is not that I want to see them
> >>>>>> but
> >>>>>> to
> >>>>>> inform them that they have a special task to do or to follow up.
> >>>>> Therefore,
> >>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>> calendar
> >>>>>> and
> >>>>>> move the appointment to this one, using the code below.
> >>>>>
>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>> meetingrequest
> >>>>>> anymore. Any help will be very appreciated.
> >>>>>
>>>>>>> With kind regards,
> >>>>>
>>>>>>> JP
> >>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>
>>>>>>> Private Sub Application_Startup()
> >>>>>> Set myAppointments =
> >>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>> End Sub
> >>>>>
>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>> Dim MyItem As AppointmentItem
> >>>>>> Dim blnPlanning As Boolean
> >>>>>> Dim strSubject As String
> >>>>>> Dim intRecipients As Integer
> >>>>>> Dim varEntryID As Variant
> >>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>> Dim MyPlanningItem As String
> >>>>>
>>>>>>> '''Stop
> >>>>>> strSubject = "*Resource Reservation*"
> >>>>>> '''blnPlanning = False
> >>>>>
>>>>>>> Set MyItem = Item
> >>>>>> MyItem.Recipients.ResolveAll
> >>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>
>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >>> Degroote
> >>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>
>>>>>>> ''' Planning Calendar exist
> >>>>>> ''' check item
> >>>>>> If MyItem.Subject Like strSubject Then
> >>>>>> blnPlanning = True
> >>>>>> Else
> >>>>>> blnPlanning = False
> >>>>>> End If
> >>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>
>>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >>> planning
> >>>>>> calendar
> >>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre

> > Degroote"
> >>>>>> Or
> >>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>>>>> blnPlanning = False
> >>>>>> Exit For
> >>>>>> End If
> >>>>>> Next intRecipients
> >>>>>
>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>> If blnPlanning = True Then
> >>>>>> With MyItem
> >>>>>> ''''.ReminderSet = False
> >>>>>> .ResponseRequested = False
> >>>>>> .Move fldPlanningCalendar
> >>>>>> .Close olDiscard
> >>>>>> End With
> >>>>>> End If
> >>>>>
>>>>>>> If blnPlanning = True Then
> >>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>> MyItem.Display
> >>>>>> End If
> >>>>>
>>>>>>> Exit_myPlanningAppointments:
> >>>>>
>>>>>>> On Error GoTo 0
> >>>>>> Exit Sub
> >>>>>
>>>>>>> Error_myPlanningAppointments:
> >>>>>> Select Case Err.Number
> >>>>>> Case -2147221233
> >>>>>> If MyItem.Subject Like strSubject Then
> >>>>>> '''For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>> ''' If MyItem.Organizer =
> >>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>> ''' Exit For
> >>>>>> ''' Else
> >>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>> ''' Exit For
> >>>>>> ''' End If
> >>>>>> '''Next intRecipients
> >>>>>> blnPlanning = True
> >>>>>> If blnPlanning = True Then
> >>>>>> MyItem.BusyStatus = olFree
> >>>>>> End If
> >>>>>> End If
> >>>>>> '''MyItem.Display
> >>>>>> Set MyItem = Nothing
> >>>>>> Resume Exit_myPlanningAppointments:
> >>>>>> Case Else
> >>>>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>>>> Buttons:=vbOKOnly
> >>>>>> Resume Exit_myPlanningAppointments
> >>>>>> End Select
> >>>>>> End Sub


>
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Have you tried to drag with the right mouse button, then choose Move instead

of Copy?

Best regards

Michael Bauer

Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:


> Hi Michael,

> It is not working like I want and I don't get it fixed.

> The behaviour of Outlook 2007 differs from 2003. When dragging an
> appointment to another calendar, Outlook 2007 makes a copy of the
> appointment and keeps the original in the calendar. Furthermore it is not
> possible to send the copy.

> Witk kind regards,

> JP

> "JP Ronse" <fb893760@skynet.be> wrote in message
> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> > Hi Michael,
>

>> Thanks for your input, I'll try your suggestion this weekend and keep you
> > posted about the result.
>

>> With kind regards,
>

>> JP
>

>> "Michael Bauer " <mb@mvps.org> wrote in message
> > news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >
>>
>>> You can see all of the available events in the object browser (f2),
> >> there's
> >> also a Close event. But as I see it, you don't need that. Please try my
> >> suggestion:
> >
>>> myitem.close oldiscard
> >> DoEvents
> >> set myitem=myitem.move(whereever)
> >> myitem.display
> >
>>> If the item doesn't get displayed, there must be an error, which you


have
> >> to
> >> catch in your error handler.
> >
>>> > >> Best regards
> >> Michael Bauer
> >>

> >>

>>
>>
>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >
>>>> Hi Michael,
> >>
>>>> My problem is with the following code lines:
> >>
>>>> Creating a meeting request fires the ItemAdd event
> >>
>>>> If blnPlanning = True Then
> >>> With MyItem
> >>> ''''.ReminderSet = False
> >>> .ResponseRequested = False
> >>> .Move fldPlanningCalendar
> >>> .Close olDiscard
> >>> End With
> >>> End If
> >>
>>>> If blnPlanning = True Then
> >>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>> MyItem.Display
> >>> End If
> >>
>>>> With blnPlanning I find out if I want to keep this meeting request in


my
> >> own
> >>> calendar or not. What was working in Outlook 2003 is moving the item to
> >> the
> >>> other calendar but because I still had to send it, it recalled it form
> >>> the
> >>> other calendar with .GetLast.
> >>
>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>> cannot
> >>> send it anymore to the recipients.
> >>
>>>> A workaround could be sending and closing the item first and move it
> >>> them
> >> as
> >>> you suggest.
> >>
>>>> Is there an ItemClose event and is it fired by sending the request?
> >>
>>>> Many, many thanks for your time and assistance.
> >>
>>>> With kind regards,
> >>
>>>> JP
> >>
>>>
>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>
>>>>
>>>>> It's hard for me to follow what your question is. However, as to your
> >>>> code:
> >>>> Assuming the item is open, I'd first close and then move it. The Move
> >>>> function returns the moved item, so there's no need to work with the
> >>>> GetLast
> >>>> function.
> >>>
>>>>> If the moved item isn't displayed, the should be an error. Your error
> >>>> handler is quite meaningless for the Else case. I'd add


Err.Description
> >> to
> >>>> the prompt, so that you know which error occurs.
> >>>
>>>>> > >>>> Best regards
> >>>> Michael Bauer
> >>>>

> >>>>

>>>>
>>>>
>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>
>>>>>> Hi Michael,
> >>>>
>>>>>> I got the error that the item was deleted (after the .move
> >>>>> instruction),
> >>>> the
> >>>>> test of this evening doesn't show this error anymore??? (During the
> >>>> weekend
> >>>>> I was testing on-line, now off-line, perhaps this can make a
> >> difference?)
> >>>>
>>>>>> The issue that I still have, is that the planning calendar has a copy
> >>>>> of
> >>>> the
> >>>>> original and that I do not longer have the possibility to send the
> >>>>> meeting
> >>>>> request. I have really to send out the requests so that the involved
> >>>>> employees are aware of it. But there is no need to keep all these
> >>>>> requests
> >>>>> in my calendar. Therefore, the checks to decide to keep it or to move
> >> it.
> >>>>
>>>>>> I cannot use .send because I must be able to edit the message or add
> >>>>> additional info before sending.
> >>>>
>>>>>> In Outlook 2003, the code below allowed to send the meeting request.
> >>>>
>>>>>> Does the .move insruction has now extra parameters to indicate a copy
> >>>>> or
> >>>>> a
> >>>>> move?
> >>>>
>>>>>> With kind regards,
> >>>>
>>>>>> JP
> >>>>
>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>
>>>>>>> What's the error message, and where does it occur?
> >>>>>
>>>>>>> > >>>>>> Best regards
> >>>>>> Michael Bauer
> >>>>>>

> >>>>>>

>>>>>>
>>>>>>
>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>
>>>>>>>> Hi All,
> >>>>>>
>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>>>>>> Bill,
> >>>>>>> a
> >>>>>>> lot of VBA-code is not working anymore.
> >>>>>>
>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>> containing
> >>>> all
> >>>>>>> teammembers with their daily schedule (they are working 24/24


-7/7).
> >>>>>>> I
> >>>>>> build
> >>>>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>>>> tasks
> >>>> to
> >>>>>> my
> >>>>>>> team.
> >>>>>>
>>>>>>>> The purpose of the meetingrequests is not that I want to see them
> >>>>>>> but
> >>>>>>> to
> >>>>>>> inform them that they have a special task to do or to follow up.
> >>>>>> Therefore,
> >>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>> calendar
> >>>>>>> and
> >>>>>>> move the appointment to this one, using the code below.
> >>>>>>
>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>> meetingrequest
> >>>>>>> anymore. Any help will be very appreciated.
> >>>>>>
>>>>>>>> With kind regards,
> >>>>>>
>>>>>>>> JP
> >>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>
>>>>>>>> Private Sub Application_Startup()
> >>>>>>> Set myAppointments =
> >>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>> End Sub
> >>>>>>
>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>> Dim MyItem As AppointmentItem
> >>>>>>> Dim blnPlanning As Boolean
> >>>>>>> Dim strSubject As String
> >>>>>>> Dim intRecipients As Integer
> >>>>>>> Dim varEntryID As Variant
> >>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>> Dim MyPlanningItem As String
> >>>>>>
>>>>>>>> '''Stop
> >>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>> '''blnPlanning = False
> >>>>>>
>>>>>>>> Set MyItem = Item
> >>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>
>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >>>> Degroote
> >>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>
>>>>>>>> ''' Planning Calendar exist
> >>>>>>> ''' check item
> >>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>> blnPlanning = True
> >>>>>>> Else
> >>>>>>> blnPlanning = False
> >>>>>>> End If
> >>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>
>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >>>> planning
> >>>>>>> calendar
> >>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >> Degroote"
> >>>>>>> Or
> >>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>>>>>> blnPlanning = False
> >>>>>>> Exit For
> >>>>>>> End If
> >>>>>>> Next intRecipients
> >>>>>>
>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>> If blnPlanning = True Then
> >>>>>>> With MyItem
> >>>>>>> ''''.ReminderSet = False
> >>>>>>> .ResponseRequested = False
> >>>>>>> .Move fldPlanningCalendar
> >>>>>>> .Close olDiscard
> >>>>>>> End With
> >>>>>>> End If
> >>>>>>
>>>>>>>> If blnPlanning = True Then
> >>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>> MyItem.Display
> >>>>>>> End If
> >>>>>>
>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>
>>>>>>>> On Error GoTo 0
> >>>>>>> Exit Sub
> >>>>>>
>>>>>>>> Error_myPlanningAppointments:
> >>>>>>> Select Case Err.Number
> >>>>>>> Case -2147221233
> >>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>> '''For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>> ''' If MyItem.Organizer =
> >>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>> ''' Exit For
> >>>>>>> ''' Else
> >>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>> ''' Exit For
> >>>>>>> ''' End If
> >>>>>>> '''Next intRecipients
> >>>>>>> blnPlanning = True
> >>>>>>> If blnPlanning = True Then
> >>>>>>> MyItem.BusyStatus = olFree
> >>>>>>> End If
> >>>>>>> End If
> >>>>>>> '''MyItem.Display
> >>>>>>> Set MyItem = Nothing
> >>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>> Case Else
> >>>>>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>>>>> Buttons:=vbOKOnly
> >>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>> End Select
> >>>>>>> End Sub

>

>>
 
J

JP Ronse

Hi Michael,

No, I dragged with the left mouse button, trying it with the right mouse

button gives indeed the options to copy or move. The "move" is then

correctly executed.

So the question remains why .move creates a copy instead of doing the move?

Should I close the item before using .move?

With kind regards,

J¨P

"Michael Bauer " <mb@mvps.org> wrote in message

news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...

> Have you tried to drag with the right mouse button, then choose Move
> instead
> of Copy?

> > Best regards
> Michael Bauer
>

>

> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
>
> > Hi Michael,
>

>> It is not working like I want and I don't get it fixed.
>

>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> > appointment to another calendar, Outlook 2007 makes a copy of the
> > appointment and keeps the original in the calendar. Furthermore it is not
> > possible to send the copy.
>

>
>> Witk kind regards,
>

>> JP
>

>
>
>> "JP Ronse" <fb893760@skynet.be> wrote in message
> > news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >> Hi Michael,
> >
>>> Thanks for your input, I'll try your suggestion this weekend and keep
> >> you
> >> posted about the result.
> >
>>> With kind regards,
> >
>>> JP
> >
>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>
>>>
>>>> You can see all of the available events in the object browser (f2),
> >>> there's
> >>> also a Close event. But as I see it, you don't need that. Please try my
> >>> suggestion:
> >>
>>>> myitem.close oldiscard
> >>> DoEvents
> >>> set myitem=myitem.move(whereever)
> >>> myitem.display
> >>
>>>> If the item doesn't get displayed, there must be an error, which you

> have
> >>> to
> >>> catch in your error handler.
> >>
>>>> > >>> Best regards
> >>> Michael Bauer
> >>>

> >>>

>>>
>>>
>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>
>>>>> Hi Michael,
> >>>
>>>>> My problem is with the following code lines:
> >>>
>>>>> Creating a meeting request fires the ItemAdd event
> >>>
>>>>> If blnPlanning = True Then
> >>>> With MyItem
> >>>> ''''.ReminderSet = False
> >>>> .ResponseRequested = False
> >>>> .Move fldPlanningCalendar
> >>>> .Close olDiscard
> >>>> End With
> >>>> End If
> >>>
>>>>> If blnPlanning = True Then
> >>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>> MyItem.Display
> >>>> End If
> >>>
>>>>> With blnPlanning I find out if I want to keep this meeting request in

> my
> >>> own
> >>>> calendar or not. What was working in Outlook 2003 is moving the item
> >>>> to
> >>> the
> >>>> other calendar but because I still had to send it, it recalled it form
> >>>> the
> >>>> other calendar with .GetLast.
> >>>
>>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>>> cannot
> >>>> send it anymore to the recipients.
> >>>
>>>>> A workaround could be sending and closing the item first and move it
> >>>> them
> >>> as
> >>>> you suggest.
> >>>
>>>>> Is there an ItemClose event and is it fired by sending the request?
> >>>
>>>>> Many, many thanks for your time and assistance.
> >>>
>>>>> With kind regards,
> >>>
>>>>> JP
> >>>
>>>>
>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>
>>>>>
>>>>>> It's hard for me to follow what your question is. However, as to your
> >>>>> code:
> >>>>> Assuming the item is open, I'd first close and then move it. The Move
> >>>>> function returns the moved item, so there's no need to work with the
> >>>>> GetLast
> >>>>> function.
> >>>>
>>>>>> If the moved item isn't displayed, the should be an error. Your error
> >>>>> handler is quite meaningless for the Else case. I'd add

> Err.Description
> >>> to
> >>>>> the prompt, so that you know which error occurs.
> >>>>
>>>>>> > >>>>> Best regards
> >>>>> Michael Bauer
> >>>>>

> >>>>>

>>>>>
>>>>>
>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>
>>>>>>> Hi Michael,
> >>>>>
>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>> instruction),
> >>>>> the
> >>>>>> test of this evening doesn't show this error anymore??? (During the
> >>>>> weekend
> >>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>> difference?)
> >>>>>
>>>>>>> The issue that I still have, is that the planning calendar has a
> >>>>>> copy
> >>>>>> of
> >>>>> the
> >>>>>> original and that I do not longer have the possibility to send the
> >>>>>> meeting
> >>>>>> request. I have really to send out the requests so that the involved
> >>>>>> employees are aware of it. But there is no need to keep all these
> >>>>>> requests
> >>>>>> in my calendar. Therefore, the checks to decide to keep it or to
> >>>>>> move
> >>> it.
> >>>>>
>>>>>>> I cannot use .send because I must be able to edit the message or add
> >>>>>> additional info before sending.
> >>>>>
>>>>>>> In Outlook 2003, the code below allowed to send the meeting request.
> >>>>>
>>>>>>> Does the .move insruction has now extra parameters to indicate a
> >>>>>> copy
> >>>>>> or
> >>>>>> a
> >>>>>> move?
> >>>>>
>>>>>>> With kind regards,
> >>>>>
>>>>>>> JP
> >>>>>
>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>
>>>>>>>> What's the error message, and where does it occur?
> >>>>>>
>>>>>>>> > >>>>>>> Best regards
> >>>>>>> Michael Bauer
> >>>>>>>

> >>>>>>>

>>>>>>>
>>>>>>>
>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>
>>>>>>>>> Hi All,
> >>>>>>>
>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks to
> >>>>>>>> Bill,
> >>>>>>>> a
> >>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>
>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>> containing
> >>>>> all
> >>>>>>>> teammembers with their daily schedule (they are working 24/24

> -7/7).
> >>>>>>>> I
> >>>>>>> build
> >>>>>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>>>>> tasks
> >>>>> to
> >>>>>>> my
> >>>>>>>> team.
> >>>>>>>
>>>>>>>>> The purpose of the meetingrequests is not that I want to see them
> >>>>>>>> but
> >>>>>>>> to
> >>>>>>>> inform them that they have a special task to do or to follow up.
> >>>>>>> Therefore,
> >>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>> calendar
> >>>>>>>> and
> >>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>
>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>> meetingrequest
> >>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>
>>>>>>>>> With kind regards,
> >>>>>>>
>>>>>>>>> JP
> >>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>
>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>> Set myAppointments =
> >>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>> End Sub
> >>>>>>>
>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>> Dim strSubject As String
> >>>>>>>> Dim intRecipients As Integer
> >>>>>>>> Dim varEntryID As Variant
> >>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>> Dim MyPlanningItem As String
> >>>>>>>
>>>>>>>>> '''Stop
> >>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>> '''blnPlanning = False
> >>>>>>>
>>>>>>>>> Set MyItem = Item
> >>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>
>>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >>>>> Degroote
> >>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>
>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>> ''' check item
> >>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>> blnPlanning = True
> >>>>>>>> Else
> >>>>>>>> blnPlanning = False
> >>>>>>>> End If
> >>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>
>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >>>>> planning
> >>>>>>>> calendar
> >>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>> Degroote"
> >>>>>>>> Or
> >>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*" Then
> >>>>>>>> blnPlanning = False
> >>>>>>>> Exit For
> >>>>>>>> End If
> >>>>>>>> Next intRecipients
> >>>>>>>
>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>> If blnPlanning = True Then
> >>>>>>>> With MyItem
> >>>>>>>> ''''.ReminderSet = False
> >>>>>>>> .ResponseRequested = False
> >>>>>>>> .Move fldPlanningCalendar
> >>>>>>>> .Close olDiscard
> >>>>>>>> End With
> >>>>>>>> End If
> >>>>>>>
>>>>>>>>> If blnPlanning = True Then
> >>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>> MyItem.Display
> >>>>>>>> End If
> >>>>>>>
>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>
>>>>>>>>> On Error GoTo 0
> >>>>>>>> Exit Sub
> >>>>>>>
>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>> Select Case Err.Number
> >>>>>>>> Case -2147221233
> >>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>> '''For intRecipients = 1 To
> >>>>>>>> MyItem.Recipients.Count
> >>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>> ''' Exit For
> >>>>>>>> ''' Else
> >>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>> ''' Exit For
> >>>>>>>> ''' End If
> >>>>>>>> '''Next intRecipients
> >>>>>>>> blnPlanning = True
> >>>>>>>> If blnPlanning = True Then
> >>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>> End If
> >>>>>>>> End If
> >>>>>>>> '''MyItem.Display
> >>>>>>>> Set MyItem = Nothing
> >>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>> Case Else
> >>>>>>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>>>>>> Buttons:=vbOKOnly
> >>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>> End Select
> >>>>>>>> End Sub
> >
>>>
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
My guess: The default has changed, now it's Copy.

Best regards

Michael Bauer

Am Mon, 15 Mar 2010 19:51:29 +0100 schrieb JP Ronse:


> Hi Michael,

> No, I dragged with the left mouse button, trying it with the right mouse
> button gives indeed the options to copy or move. The "move" is then
> correctly executed.

> So the question remains why .move creates a copy instead of doing the


move?

> Should I close the item before using .move?

> With kind regards,

> J¨P

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...
>

>
>> Have you tried to drag with the right mouse button, then choose Move
> > instead
> > of Copy?
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
> >
> >> Hi Michael,
> >
>>> It is not working like I want and I don't get it fixed.
> >
>>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> >> appointment to another calendar, Outlook 2007 makes a copy of the
> >> appointment and keeps the original in the calendar. Furthermore it is


not
> >> possible to send the copy.
> >
>>
>>> Witk kind regards,
> >
>>> JP
> >
>>
>>
>>> "JP Ronse" <fb893760@skynet.be> wrote in message
> >> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >>> Hi Michael,
> >>
>>>> Thanks for your input, I'll try your suggestion this weekend and keep
> >>> you
> >>> posted about the result.
> >>
>>>> With kind regards,
> >>
>>>> JP
> >>
>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>>
>>>>
>>>>> You can see all of the available events in the object browser (f2),
> >>>> there's
> >>>> also a Close event. But as I see it, you don't need that. Please try


my
> >>>> suggestion:
> >>>
>>>>> myitem.close oldiscard
> >>>> DoEvents
> >>>> set myitem=myitem.move(whereever)
> >>>> myitem.display
> >>>
>>>>> If the item doesn't get displayed, there must be an error, which you

> > have
> >>>> to
> >>>> catch in your error handler.
> >>>
>>>>> > >>>> Best regards
> >>>> Michael Bauer
> >>>>

> >>>>

>>>>
>>>>
>>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>>
>>>>>> Hi Michael,
> >>>>
>>>>>> My problem is with the following code lines:
> >>>>
>>>>>> Creating a meeting request fires the ItemAdd event
> >>>>
>>>>>> If blnPlanning = True Then
> >>>>> With MyItem
> >>>>> ''''.ReminderSet = False
> >>>>> .ResponseRequested = False
> >>>>> .Move fldPlanningCalendar
> >>>>> .Close olDiscard
> >>>>> End With
> >>>>> End If
> >>>>
>>>>>> If blnPlanning = True Then
> >>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>> MyItem.Display
> >>>>> End If
> >>>>
>>>>>> With blnPlanning I find out if I want to keep this meeting request in

> > my
> >>>> own
> >>>>> calendar or not. What was working in Outlook 2003 is moving the item
> >>>>> to
> >>>> the
> >>>>> other calendar but because I still had to send it, it recalled it


form
> >>>>> the
> >>>>> other calendar with .GetLast.
> >>>>
>>>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>>>> cannot
> >>>>> send it anymore to the recipients.
> >>>>
>>>>>> A workaround could be sending and closing the item first and move it
> >>>>> them
> >>>> as
> >>>>> you suggest.
> >>>>
>>>>>> Is there an ItemClose event and is it fired by sending the request?
> >>>>
>>>>>> Many, many thanks for your time and assistance.
> >>>>
>>>>>> With kind regards,
> >>>>
>>>>>> JP
> >>>>
>>>>>
>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>>
>>>>>>
>>>>>>> It's hard for me to follow what your question is. However, as to


your
> >>>>>> code:
> >>>>>> Assuming the item is open, I'd first close and then move it. The


Move
> >>>>>> function returns the moved item, so there's no need to work with the
> >>>>>> GetLast
> >>>>>> function.
> >>>>>
>>>>>>> If the moved item isn't displayed, the should be an error. Your


error
> >>>>>> handler is quite meaningless for the Else case. I'd add

> > Err.Description
> >>>> to
> >>>>>> the prompt, so that you know which error occurs.
> >>>>>
>>>>>>> > >>>>>> Best regards
> >>>>>> Michael Bauer
> >>>>>>

> >>>>>>

>>>>>>
>>>>>>
>>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>>
>>>>>>>> Hi Michael,
> >>>>>>
>>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>>> instruction),
> >>>>>> the
> >>>>>>> test of this evening doesn't show this error anymore??? (During the
> >>>>>> weekend
> >>>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>>> difference?)
> >>>>>>
>>>>>>>> The issue that I still have, is that the planning calendar has a
> >>>>>>> copy
> >>>>>>> of
> >>>>>> the
> >>>>>>> original and that I do not longer have the possibility to send the
> >>>>>>> meeting
> >>>>>>> request. I have really to send out the requests so that the


involved
> >>>>>>> employees are aware of it. But there is no need to keep all these
> >>>>>>> requests
> >>>>>>> in my calendar. Therefore, the checks to decide to keep it or to
> >>>>>>> move
> >>>> it.
> >>>>>>
>>>>>>>> I cannot use .send because I must be able to edit the message or


add
> >>>>>>> additional info before sending.
> >>>>>>
>>>>>>>> In Outlook 2003, the code below allowed to send the meeting


request.
> >>>>>>
>>>>>>>> Does the .move insruction has now extra parameters to indicate a
> >>>>>>> copy
> >>>>>>> or
> >>>>>>> a
> >>>>>>> move?
> >>>>>>
>>>>>>>> With kind regards,
> >>>>>>
>>>>>>>> JP
> >>>>>>
>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>>
>>>>>>>>> What's the error message, and where does it occur?
> >>>>>>>
>>>>>>>>> > >>>>>>>> Best regards
> >>>>>>>> Michael Bauer
> >>>>>>>>

> >>>>>>>>

>>>>>>>>
>>>>>>>>
>>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>>
>>>>>>>>>> Hi All,
> >>>>>>>>
>>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks


to
> >>>>>>>>> Bill,
> >>>>>>>>> a
> >>>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>>
>>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>>> containing
> >>>>>> all
> >>>>>>>>> teammembers with their daily schedule (they are working 24/24

> > -7/7).
> >>>>>>>>> I
> >>>>>>>> build
> >>>>>>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>>>>>> tasks
> >>>>>> to
> >>>>>>>> my
> >>>>>>>>> team.
> >>>>>>>>
>>>>>>>>>> The purpose of the meetingrequests is not that I want to see them
> >>>>>>>>> but
> >>>>>>>>> to
> >>>>>>>>> inform them that they have a special task to do or to follow up.
> >>>>>>>> Therefore,
> >>>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>>> calendar
> >>>>>>>>> and
> >>>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>>
>>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>>> meetingrequest
> >>>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>>
>>>>>>>>>> With kind regards,
> >>>>>>>>
>>>>>>>>>> JP
> >>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>>
>>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>>> Set myAppointments =
> >>>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>>> End Sub
> >>>>>>>>
>>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>>> Dim strSubject As String
> >>>>>>>>> Dim intRecipients As Integer
> >>>>>>>>> Dim varEntryID As Variant
> >>>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>>> Dim MyPlanningItem As String
> >>>>>>>>
>>>>>>>>>> '''Stop
> >>>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>>> '''blnPlanning = False
> >>>>>>>>
>>>>>>>>>> Set MyItem = Item
> >>>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>>
>>>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >>>>>> Degroote
> >>>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>>
>>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>>> ''' check item
> >>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>> blnPlanning = True
> >>>>>>>>> Else
> >>>>>>>>> blnPlanning = False
> >>>>>>>>> End If
> >>>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>>
>>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >>>>>> planning
> >>>>>>>>> calendar
> >>>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>>> Degroote"
> >>>>>>>>> Or
> >>>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*"


Then
> >>>>>>>>> blnPlanning = False
> >>>>>>>>> Exit For
> >>>>>>>>> End If
> >>>>>>>>> Next intRecipients
> >>>>>>>>
>>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>>> If blnPlanning = True Then
> >>>>>>>>> With MyItem
> >>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>> .ResponseRequested = False
> >>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>> .Close olDiscard
> >>>>>>>>> End With
> >>>>>>>>> End If
> >>>>>>>>
>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>> MyItem.Display
> >>>>>>>>> End If
> >>>>>>>>
>>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>>
>>>>>>>>>> On Error GoTo 0
> >>>>>>>>> Exit Sub
> >>>>>>>>
>>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>>> Select Case Err.Number
> >>>>>>>>> Case -2147221233
> >>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>> '''For intRecipients = 1 To
> >>>>>>>>> MyItem.Recipients.Count
> >>>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>>> ''' Exit For
> >>>>>>>>> ''' Else
> >>>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>>> ''' Exit For
> >>>>>>>>> ''' End If
> >>>>>>>>> '''Next intRecipients
> >>>>>>>>> blnPlanning = True
> >>>>>>>>> If blnPlanning = True Then
> >>>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>>> End If
> >>>>>>>>> End If
> >>>>>>>>> '''MyItem.Display
> >>>>>>>>> Set MyItem = Nothing
> >>>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>>> Case Else
> >>>>>>>>> MsgBox prompt:="An error occured.", Title:="Warning",
> >>>>>>>>> Buttons:=vbOKOnly
> >>>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>>> End Select
> >>>>>>>>> End Sub
> >>
>>>>
 
J

JP Ronse

An idea how to force move then with VBA?

"Michael Bauer " <mb@mvps.org> wrote in message

news:1w6wxsvcktjtp$.1tcj4vevsvkgj$.dlg@40tude.net...

> My guess: The default has changed, now it's Copy.

> > Best regards
> Michael Bauer
>

>

> Am Mon, 15 Mar 2010 19:51:29 +0100 schrieb JP Ronse:
>
> > Hi Michael,
>

>> No, I dragged with the left mouse button, trying it with the right mouse
> > button gives indeed the options to copy or move. The "move" is then
> > correctly executed.
>

>
>> So the question remains why .move creates a copy instead of doing the

> move?
>

>> Should I close the item before using .move?
>

>> With kind regards,
>

>> J¨P
>

>
>
>> "Michael Bauer " <mb@mvps.org> wrote in message
> > news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...
> >
>>
>>> Have you tried to drag with the right mouse button, then choose Move
> >> instead
> >> of Copy?
> >
>>> > >> Best regards
> >> Michael Bauer
> >>

> >>

>>
>>
>>> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
> >
>>>> Hi Michael,
> >>
>>>> It is not working like I want and I don't get it fixed.
> >>
>>>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> >>> appointment to another calendar, Outlook 2007 makes a copy of the
> >>> appointment and keeps the original in the calendar. Furthermore it is

> not
> >>> possible to send the copy.
> >>
>>>
>>>> Witk kind regards,
> >>
>>>> JP
> >>
>>>
>>>
>>>> "JP Ronse" <fb893760@skynet.be> wrote in message
> >>> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >>>> Hi Michael,
> >>>
>>>>> Thanks for your input, I'll try your suggestion this weekend and keep
> >>>> you
> >>>> posted about the result.
> >>>
>>>>> With kind regards,
> >>>
>>>>> JP
> >>>
>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>>>
>>>>>
>>>>>> You can see all of the available events in the object browser (f2),
> >>>>> there's
> >>>>> also a Close event. But as I see it, you don't need that. Please try

> my
> >>>>> suggestion:
> >>>>
>>>>>> myitem.close oldiscard
> >>>>> DoEvents
> >>>>> set myitem=myitem.move(whereever)
> >>>>> myitem.display
> >>>>
>>>>>> If the item doesn't get displayed, there must be an error, which you
> >> have
> >>>>> to
> >>>>> catch in your error handler.
> >>>>
>>>>>> > >>>>> Best regards
> >>>>> Michael Bauer
> >>>>>

> >>>>>

>>>>>
>>>>>
>>>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>>>
>>>>>>> Hi Michael,
> >>>>>
>>>>>>> My problem is with the following code lines:
> >>>>>
>>>>>>> Creating a meeting request fires the ItemAdd event
> >>>>>
>>>>>>> If blnPlanning = True Then
> >>>>>> With MyItem
> >>>>>> ''''.ReminderSet = False
> >>>>>> .ResponseRequested = False
> >>>>>> .Move fldPlanningCalendar
> >>>>>> .Close olDiscard
> >>>>>> End With
> >>>>>> End If
> >>>>>
>>>>>>> If blnPlanning = True Then
> >>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>> MyItem.Display
> >>>>>> End If
> >>>>>
>>>>>>> With blnPlanning I find out if I want to keep this meeting request
> >>>>>> in
> >> my
> >>>>> own
> >>>>>> calendar or not. What was working in Outlook 2003 is moving the item
> >>>>>> to
> >>>>> the
> >>>>>> other calendar but because I still had to send it, it recalled it

> form
> >>>>>> the
> >>>>>> other calendar with .GetLast.
> >>>>>
>>>>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>>>>> cannot
> >>>>>> send it anymore to the recipients.
> >>>>>
>>>>>>> A workaround could be sending and closing the item first and move it
> >>>>>> them
> >>>>> as
> >>>>>> you suggest.
> >>>>>
>>>>>>> Is there an ItemClose event and is it fired by sending the request?
> >>>>>
>>>>>>> Many, many thanks for your time and assistance.
> >>>>>
>>>>>>> With kind regards,
> >>>>>
>>>>>>> JP
> >>>>>
>>>>>>
>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>>>
>>>>>>>
>>>>>>>> It's hard for me to follow what your question is. However, as to

> your
> >>>>>>> code:
> >>>>>>> Assuming the item is open, I'd first close and then move it. The

> Move
> >>>>>>> function returns the moved item, so there's no need to work with
> >>>>>>> the
> >>>>>>> GetLast
> >>>>>>> function.
> >>>>>>
>>>>>>>> If the moved item isn't displayed, the should be an error. Your

> error
> >>>>>>> handler is quite meaningless for the Else case. I'd add
> >> Err.Description
> >>>>> to
> >>>>>>> the prompt, so that you know which error occurs.
> >>>>>>
>>>>>>>> > >>>>>>> Best regards
> >>>>>>> Michael Bauer
> >>>>>>>

> >>>>>>>

>>>>>>>
>>>>>>>
>>>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>>>
>>>>>>>>> Hi Michael,
> >>>>>>>
>>>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>>>> instruction),
> >>>>>>> the
> >>>>>>>> test of this evening doesn't show this error anymore??? (During
> >>>>>>>> the
> >>>>>>> weekend
> >>>>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>>>> difference?)
> >>>>>>>
>>>>>>>>> The issue that I still have, is that the planning calendar has a
> >>>>>>>> copy
> >>>>>>>> of
> >>>>>>> the
> >>>>>>>> original and that I do not longer have the possibility to send the
> >>>>>>>> meeting
> >>>>>>>> request. I have really to send out the requests so that the

> involved
> >>>>>>>> employees are aware of it. But there is no need to keep all these
> >>>>>>>> requests
> >>>>>>>> in my calendar. Therefore, the checks to decide to keep it or to
> >>>>>>>> move
> >>>>> it.
> >>>>>>>
>>>>>>>>> I cannot use .send because I must be able to edit the message or

> add
> >>>>>>>> additional info before sending.
> >>>>>>>
>>>>>>>>> In Outlook 2003, the code below allowed to send the meeting

> request.
> >>>>>>>
>>>>>>>>> Does the .move insruction has now extra parameters to indicate a
> >>>>>>>> copy
> >>>>>>>> or
> >>>>>>>> a
> >>>>>>>> move?
> >>>>>>>
>>>>>>>>> With kind regards,
> >>>>>>>
>>>>>>>>> JP
> >>>>>>>
>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>>>
>>>>>>>>>> What's the error message, and where does it occur?
> >>>>>>>>
>>>>>>>>>> > >>>>>>>>> Best regards
> >>>>>>>>> Michael Bauer
> >>>>>>>>>

> >>>>>>>>>

>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>>>
>>>>>>>>>>> Hi All,
> >>>>>>>>>
>>>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks

> to
> >>>>>>>>>> Bill,
> >>>>>>>>>> a
> >>>>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>>>
>>>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>>>> containing
> >>>>>>> all
> >>>>>>>>>> teammembers with their daily schedule (they are working 24/24
> >> -7/7).
> >>>>>>>>>> I
> >>>>>>>>> build
> >>>>>>>>>> some code in Excel to create tasks or meetingrequests to assign
> >>>>>>>>>> tasks
> >>>>>>> to
> >>>>>>>>> my
> >>>>>>>>>> team.
> >>>>>>>>>
>>>>>>>>>>> The purpose of the meetingrequests is not that I want to see
> >>>>>>>>>> them
> >>>>>>>>>> but
> >>>>>>>>>> to
> >>>>>>>>>> inform them that they have a special task to do or to follow up.
> >>>>>>>>> Therefore,
> >>>>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>>>> calendar
> >>>>>>>>>> and
> >>>>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>>>
>>>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>>>> meetingrequest
> >>>>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>>>
>>>>>>>>>>> With kind regards,
> >>>>>>>>>
>>>>>>>>>>> JP
> >>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>>>
>>>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>>>> Set myAppointments =
> >>>>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>>>> End Sub
> >>>>>>>>>
>>>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>>>> Dim strSubject As String
> >>>>>>>>>> Dim intRecipients As Integer
> >>>>>>>>>> Dim varEntryID As Variant
> >>>>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>>>> Dim MyPlanningItem As String
> >>>>>>>>>
>>>>>>>>>>> '''Stop
> >>>>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>>>> '''blnPlanning = False
> >>>>>>>>>
>>>>>>>>>>> Set MyItem = Item
> >>>>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>>>
>>>>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox -
> >>>>>>> Degroote
> >>>>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>>>
>>>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>>>> ''' check item
> >>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>> blnPlanning = True
> >>>>>>>>>> Else
> >>>>>>>>>> blnPlanning = False
> >>>>>>>>>> End If
> >>>>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>>>
>>>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved to
> >>>>>>> planning
> >>>>>>>>>> calendar
> >>>>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>>>> Degroote"
> >>>>>>>>>> Or
> >>>>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*" Or
> >>>>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*"

> Then
> >>>>>>>>>> blnPlanning = False
> >>>>>>>>>> Exit For
> >>>>>>>>>> End If
> >>>>>>>>>> Next intRecipients
> >>>>>>>>>
>>>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>> With MyItem
> >>>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>>> .ResponseRequested = False
> >>>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>>> .Close olDiscard
> >>>>>>>>>> End With
> >>>>>>>>>> End If
> >>>>>>>>>
>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>>> MyItem.Display
> >>>>>>>>>> End If
> >>>>>>>>>
>>>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>>>
>>>>>>>>>>> On Error GoTo 0
> >>>>>>>>>> Exit Sub
> >>>>>>>>>
>>>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>>>> Select Case Err.Number
> >>>>>>>>>> Case -2147221233
> >>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>> '''For intRecipients = 1 To
> >>>>>>>>>> MyItem.Recipients.Count
> >>>>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>>>> ''' Exit For
> >>>>>>>>>> ''' Else
> >>>>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>>>> ''' Exit For
> >>>>>>>>>> ''' End If
> >>>>>>>>>> '''Next intRecipients
> >>>>>>>>>> blnPlanning = True
> >>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>>>> End If
> >>>>>>>>>> End If
> >>>>>>>>>> '''MyItem.Display
> >>>>>>>>>> Set MyItem = Nothing
> >>>>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>>>> Case Else
> >>>>>>>>>> MsgBox prompt:="An error occured.",
> >>>>>>>>>> Title:="Warning",
> >>>>>>>>>> Buttons:=vbOKOnly
> >>>>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>>>> End Select
> >>>>>>>>>> End Sub
> >>>
>>>>>
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I don't see that you've tried my suggestion. Again, check for errors please

and tell us what happens.

Best regards

Michael Bauer

Am Tue, 16 Mar 2010 17:51:48 +0100 schrieb JP Ronse:


> An idea how to force move then with VBA?

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:1w6wxsvcktjtp$.1tcj4vevsvkgj$.dlg@40tude.net...
>

>
>> My guess: The default has changed, now it's Copy.
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Mon, 15 Mar 2010 19:51:29 +0100 schrieb JP Ronse:
> >
> >> Hi Michael,
> >
>>> No, I dragged with the left mouse button, trying it with the right mouse
> >> button gives indeed the options to copy or move. The "move" is then
> >> correctly executed.
> >
>>
>>> So the question remains why .move creates a copy instead of doing the

> > move?
> >
>>> Should I close the item before using .move?
> >
>>> With kind regards,
> >
>>> J¨P
> >
>>
>>
>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >> news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...
> >>
>>>
>>>> Have you tried to drag with the right mouse button, then choose Move
> >>> instead
> >>> of Copy?
> >>
>>>> > >>> Best regards
> >>> Michael Bauer
> >>>

> >>>

>>>
>>>
>>>> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
> >>
>>>>> Hi Michael,
> >>>
>>>>> It is not working like I want and I don't get it fixed.
> >>>
>>>>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> >>>> appointment to another calendar, Outlook 2007 makes a copy of the
> >>>> appointment and keeps the original in the calendar. Furthermore it is

> > not
> >>>> possible to send the copy.
> >>>
>>>>
>>>>> Witk kind regards,
> >>>
>>>>> JP
> >>>
>>>>
>>>>
>>>>> "JP Ronse" <fb893760@skynet.be> wrote in message
> >>>> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >>>>> Hi Michael,
> >>>>
>>>>>> Thanks for your input, I'll try your suggestion this weekend and keep
> >>>>> you
> >>>>> posted about the result.
> >>>>
>>>>>> With kind regards,
> >>>>
>>>>>> JP
> >>>>
>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>>>>
>>>>>>
>>>>>>> You can see all of the available events in the object browser (f2),
> >>>>>> there's
> >>>>>> also a Close event. But as I see it, you don't need that. Please try

> > my
> >>>>>> suggestion:
> >>>>>
>>>>>>> myitem.close oldiscard
> >>>>>> DoEvents
> >>>>>> set myitem=myitem.move(whereever)
> >>>>>> myitem.display
> >>>>>
>>>>>>> If the item doesn't get displayed, there must be an error, which you
> >>> have
> >>>>>> to
> >>>>>> catch in your error handler.
> >>>>>
>>>>>>> > >>>>>> Best regards
> >>>>>> Michael Bauer
> >>>>>>

> >>>>>>

>>>>>>
>>>>>>
>>>>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>>>>
>>>>>>>> Hi Michael,
> >>>>>>
>>>>>>>> My problem is with the following code lines:
> >>>>>>
>>>>>>>> Creating a meeting request fires the ItemAdd event
> >>>>>>
>>>>>>>> If blnPlanning = True Then
> >>>>>>> With MyItem
> >>>>>>> ''''.ReminderSet = False
> >>>>>>> .ResponseRequested = False
> >>>>>>> .Move fldPlanningCalendar
> >>>>>>> .Close olDiscard
> >>>>>>> End With
> >>>>>>> End If
> >>>>>>
>>>>>>>> If blnPlanning = True Then
> >>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>> MyItem.Display
> >>>>>>> End If
> >>>>>>
>>>>>>>> With blnPlanning I find out if I want to keep this meeting request
> >>>>>>> in
> >>> my
> >>>>>> own
> >>>>>>> calendar or not. What was working in Outlook 2003 is moving the


item
> >>>>>>> to
> >>>>>> the
> >>>>>>> other calendar but because I still had to send it, it recalled it

> > form
> >>>>>>> the
> >>>>>>> other calendar with .GetLast.
> >>>>>>
>>>>>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>>>>>> cannot
> >>>>>>> send it anymore to the recipients.
> >>>>>>
>>>>>>>> A workaround could be sending and closing the item first and move


it
> >>>>>>> them
> >>>>>> as
> >>>>>>> you suggest.
> >>>>>>
>>>>>>>> Is there an ItemClose event and is it fired by sending the request?
> >>>>>>
>>>>>>>> Many, many thanks for your time and assistance.
> >>>>>>
>>>>>>>> With kind regards,
> >>>>>>
>>>>>>>> JP
> >>>>>>
>>>>>>>
>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>>>>
>>>>>>>>
>>>>>>>>> It's hard for me to follow what your question is. However, as to

> > your
> >>>>>>>> code:
> >>>>>>>> Assuming the item is open, I'd first close and then move it. The

> > Move
> >>>>>>>> function returns the moved item, so there's no need to work with
> >>>>>>>> the
> >>>>>>>> GetLast
> >>>>>>>> function.
> >>>>>>>
>>>>>>>>> If the moved item isn't displayed, the should be an error. Your

> > error
> >>>>>>>> handler is quite meaningless for the Else case. I'd add
> >>> Err.Description
> >>>>>> to
> >>>>>>>> the prompt, so that you know which error occurs.
> >>>>>>>
>>>>>>>>> > >>>>>>>> Best regards
> >>>>>>>> Michael Bauer
> >>>>>>>>

> >>>>>>>>

>>>>>>>>
>>>>>>>>
>>>>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>>>>
>>>>>>>>>> Hi Michael,
> >>>>>>>>
>>>>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>>>>> instruction),
> >>>>>>>> the
> >>>>>>>>> test of this evening doesn't show this error anymore??? (During
> >>>>>>>>> the
> >>>>>>>> weekend
> >>>>>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>>>>> difference?)
> >>>>>>>>
>>>>>>>>>> The issue that I still have, is that the planning calendar has a
> >>>>>>>>> copy
> >>>>>>>>> of
> >>>>>>>> the
> >>>>>>>>> original and that I do not longer have the possibility to send


the
> >>>>>>>>> meeting
> >>>>>>>>> request. I have really to send out the requests so that the

> > involved
> >>>>>>>>> employees are aware of it. But there is no need to keep all these
> >>>>>>>>> requests
> >>>>>>>>> in my calendar. Therefore, the checks to decide to keep it or to
> >>>>>>>>> move
> >>>>>> it.
> >>>>>>>>
>>>>>>>>>> I cannot use .send because I must be able to edit the message or

> > add
> >>>>>>>>> additional info before sending.
> >>>>>>>>
>>>>>>>>>> In Outlook 2003, the code below allowed to send the meeting

> > request.
> >>>>>>>>
>>>>>>>>>> Does the .move insruction has now extra parameters to indicate a
> >>>>>>>>> copy
> >>>>>>>>> or
> >>>>>>>>> a
> >>>>>>>>> move?
> >>>>>>>>
>>>>>>>>>> With kind regards,
> >>>>>>>>
>>>>>>>>>> JP
> >>>>>>>>
>>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>>>>
>>>>>>>>>>> What's the error message, and where does it occur?
> >>>>>>>>>
>>>>>>>>>>> > >>>>>>>>>> Best regards
> >>>>>>>>>> Michael Bauer
> >>>>>>>>>>

> >>>>>>>>>>

>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>>>>
>>>>>>>>>>>> Hi All,
> >>>>>>>>>>
>>>>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh thanks

> > to
> >>>>>>>>>>> Bill,
> >>>>>>>>>>> a
> >>>>>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>>>>
>>>>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>>>>> containing
> >>>>>>>> all
> >>>>>>>>>>> teammembers with their daily schedule (they are working 24/24
> >>> -7/7).
> >>>>>>>>>>> I
> >>>>>>>>>> build
> >>>>>>>>>>> some code in Excel to create tasks or meetingrequests to


assign
> >>>>>>>>>>> tasks
> >>>>>>>> to
> >>>>>>>>>> my
> >>>>>>>>>>> team.
> >>>>>>>>>>
>>>>>>>>>>>> The purpose of the meetingrequests is not that I want to see
> >>>>>>>>>>> them
> >>>>>>>>>>> but
> >>>>>>>>>>> to
> >>>>>>>>>>> inform them that they have a special task to do or to follow


up.
> >>>>>>>>>> Therefore,
> >>>>>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>>>>> calendar
> >>>>>>>>>>> and
> >>>>>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>>>>
>>>>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>>>>> meetingrequest
> >>>>>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>>>>
>>>>>>>>>>>> With kind regards,
> >>>>>>>>>>
>>>>>>>>>>>> JP
> >>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>>>>
>>>>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>>>>> Set myAppointments =
> >>>>>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>>>>> End Sub
> >>>>>>>>>>
>>>>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>>>>> Dim strSubject As String
> >>>>>>>>>>> Dim intRecipients As Integer
> >>>>>>>>>>> Dim varEntryID As Variant
> >>>>>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>>>>> Dim MyPlanningItem As String
> >>>>>>>>>>
>>>>>>>>>>>> '''Stop
> >>>>>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>>>>> '''blnPlanning = False
> >>>>>>>>>>
>>>>>>>>>>>> Set MyItem = Item
> >>>>>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>>>>
>>>>>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox


-
> >>>>>>>> Degroote
> >>>>>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>>>>
>>>>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>>>>> ''' check item
> >>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>> Else
> >>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>> End If
> >>>>>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>>>>
>>>>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved


to
> >>>>>>>> planning
> >>>>>>>>>>> calendar
> >>>>>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>>>>> Degroote"
> >>>>>>>>>>> Or
> >>>>>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*"


Or
> >>>>>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*"

> > Then
> >>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>> Exit For
> >>>>>>>>>>> End If
> >>>>>>>>>>> Next intRecipients
> >>>>>>>>>>
>>>>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>> With MyItem
> >>>>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>>>> .ResponseRequested = False
> >>>>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>>>> .Close olDiscard
> >>>>>>>>>>> End With
> >>>>>>>>>>> End If
> >>>>>>>>>>
>>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>>>> MyItem.Display
> >>>>>>>>>>> End If
> >>>>>>>>>>
>>>>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>>>>
>>>>>>>>>>>> On Error GoTo 0
> >>>>>>>>>>> Exit Sub
> >>>>>>>>>>
>>>>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>>>>> Select Case Err.Number
> >>>>>>>>>>> Case -2147221233
> >>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>> '''For intRecipients = 1 To
> >>>>>>>>>>> MyItem.Recipients.Count
> >>>>>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>>>>> ''' Exit For
> >>>>>>>>>>> ''' Else
> >>>>>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>>>>> ''' Exit For
> >>>>>>>>>>> ''' End If
> >>>>>>>>>>> '''Next intRecipients
> >>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>>>>> End If
> >>>>>>>>>>> End If
> >>>>>>>>>>> '''MyItem.Display
> >>>>>>>>>>> Set MyItem = Nothing
> >>>>>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>>>>> Case Else
> >>>>>>>>>>> MsgBox prompt:="An error occured.",
> >>>>>>>>>>> Title:="Warning",
> >>>>>>>>>>> Buttons:=vbOKOnly
> >>>>>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>>>>> End Select
> >>>>>>>>>>> End Sub
> >>>>
>>>>>>
 
J

JP Ronse

Hi Michael,

Sorry, I've tried your suggestion but did not get the expected result.

With following code:

Public WithEvents myAppointments As Outlook.Items

Private Sub Application_Startup()

Set myAppointments =

Outlook.Session.GetDefaultFolder(olFolderCalendar).Items

End Sub

Private Sub myAppointments_ItemAdd(ByVal Item As Object)

Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote

Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

Set MyItem = Item

MyItem.Close olSave

DoEvents

Set MyItem = MyItem.Move(fldPlanningCalendar)

MyItem.Display

End Sub

The meetingItem is now a copy of the original which I can't send.

Changing the code a bit (marked with ***)

Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote

Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

Set MyItem = Item

MyItem.Close olSave

DoEvents

*** MyItem.Move (fldPlanningCalendar)

MyItem.Display

Gives run-time error 424, change:

MyItem.Move (fldPlanningCalendar) to MyItem.Move fldPlanningCalendar

Now the meetingItem is opened and the send button is available.

Click Send => "The operation cannot be performed because the object has been

deleted."

There are no other errors trapped.

With kind regards,

JP

"Michael Bauer " <mb@mvps.org> wrote in message

news:14hpzczz9e1l8.e8eno0a7drnd.dlg@40tude.net...

> I don't see that you've tried my suggestion. Again, check for errors
> please
> and tell us what happens.

> > Best regards
> Michael Bauer
>

>

> Am Tue, 16 Mar 2010 17:51:48 +0100 schrieb JP Ronse:
>
> > An idea how to force move then with VBA?
>

>
>> "Michael Bauer " <mb@mvps.org> wrote in message
> > news:1w6wxsvcktjtp$.1tcj4vevsvkgj$.dlg@40tude.net...
> >
>>
>>> My guess: The default has changed, now it's Copy.
> >
>>> > >> Best regards
> >> Michael Bauer
> >>

> >>

>>
>>
>>> Am Mon, 15 Mar 2010 19:51:29 +0100 schrieb JP Ronse:
> >
>>>> Hi Michael,
> >>
>>>> No, I dragged with the left mouse button, trying it with the right
> >>> mouse
> >>> button gives indeed the options to copy or move. The "move" is then
> >>> correctly executed.
> >>
>>>
>>>> So the question remains why .move creates a copy instead of doing the
> >> move?
> >>
>>>> Should I close the item before using .move?
> >>
>>>> With kind regards,
> >>
>>>> J¨P
> >>
>>>
>>>
>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>> news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...
> >>>
>>>>
>>>>> Have you tried to drag with the right mouse button, then choose Move
> >>>> instead
> >>>> of Copy?
> >>>
>>>>> > >>>> Best regards
> >>>> Michael Bauer
> >>>>

> >>>>

>>>>
>>>>
>>>>> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
> >>>
>>>>>> Hi Michael,
> >>>>
>>>>>> It is not working like I want and I don't get it fixed.
> >>>>
>>>>>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> >>>>> appointment to another calendar, Outlook 2007 makes a copy of the
> >>>>> appointment and keeps the original in the calendar. Furthermore it is
> >> not
> >>>>> possible to send the copy.
> >>>>
>>>>>
>>>>>> Witk kind regards,
> >>>>
>>>>>> JP
> >>>>
>>>>>
>>>>>
>>>>>> "JP Ronse" <fb893760@skynet.be> wrote in message
> >>>>> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >>>>>> Hi Michael,
> >>>>>
>>>>>>> Thanks for your input, I'll try your suggestion this weekend and
> >>>>>> keep
> >>>>>> you
> >>>>>> posted about the result.
> >>>>>
>>>>>>> With kind regards,
> >>>>>
>>>>>>> JP
> >>>>>
>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>>>>>
>>>>>>>
>>>>>>>> You can see all of the available events in the object browser (f2),
> >>>>>>> there's
> >>>>>>> also a Close event. But as I see it, you don't need that. Please
> >>>>>>> try
> >> my
> >>>>>>> suggestion:
> >>>>>>
>>>>>>>> myitem.close oldiscard
> >>>>>>> DoEvents
> >>>>>>> set myitem=myitem.move(whereever)
> >>>>>>> myitem.display
> >>>>>>
>>>>>>>> If the item doesn't get displayed, there must be an error, which
> >>>>>>> you
> >>>> have
> >>>>>>> to
> >>>>>>> catch in your error handler.
> >>>>>>
>>>>>>>> > >>>>>>> Best regards
> >>>>>>> Michael Bauer
> >>>>>>>

> >>>>>>>

>>>>>>>
>>>>>>>
>>>>>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>>>>>
>>>>>>>>> Hi Michael,
> >>>>>>>
>>>>>>>>> My problem is with the following code lines:
> >>>>>>>
>>>>>>>>> Creating a meeting request fires the ItemAdd event
> >>>>>>>
>>>>>>>>> If blnPlanning = True Then
> >>>>>>>> With MyItem
> >>>>>>>> ''''.ReminderSet = False
> >>>>>>>> .ResponseRequested = False
> >>>>>>>> .Move fldPlanningCalendar
> >>>>>>>> .Close olDiscard
> >>>>>>>> End With
> >>>>>>>> End If
> >>>>>>>
>>>>>>>>> If blnPlanning = True Then
> >>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>> MyItem.Display
> >>>>>>>> End If
> >>>>>>>
>>>>>>>>> With blnPlanning I find out if I want to keep this meeting request
> >>>>>>>> in
> >>>> my
> >>>>>>> own
> >>>>>>>> calendar or not. What was working in Outlook 2003 is moving the

> item
> >>>>>>>> to
> >>>>>>> the
> >>>>>>>> other calendar but because I still had to send it, it recalled it
> >> form
> >>>>>>>> the
> >>>>>>>> other calendar with .GetLast.
> >>>>>>>
>>>>>>>>> In outlook 2007, the moved item is a copy of the original and so I
> >>>>>>>> cannot
> >>>>>>>> send it anymore to the recipients.
> >>>>>>>
>>>>>>>>> A workaround could be sending and closing the item first and move

> it
> >>>>>>>> them
> >>>>>>> as
> >>>>>>>> you suggest.
> >>>>>>>
>>>>>>>>> Is there an ItemClose event and is it fired by sending the
> >>>>>>>> request?
> >>>>>>>
>>>>>>>>> Many, many thanks for your time and assistance.
> >>>>>>>
>>>>>>>>> With kind regards,
> >>>>>>>
>>>>>>>>> JP
> >>>>>>>
>>>>>>>>
>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>>>>>
>>>>>>>>>
>>>>>>>>>> It's hard for me to follow what your question is. However, as to
> >> your
> >>>>>>>>> code:
> >>>>>>>>> Assuming the item is open, I'd first close and then move it. The
> >> Move
> >>>>>>>>> function returns the moved item, so there's no need to work with
> >>>>>>>>> the
> >>>>>>>>> GetLast
> >>>>>>>>> function.
> >>>>>>>>
>>>>>>>>>> If the moved item isn't displayed, the should be an error. Your
> >> error
> >>>>>>>>> handler is quite meaningless for the Else case. I'd add
> >>>> Err.Description
> >>>>>>> to
> >>>>>>>>> the prompt, so that you know which error occurs.
> >>>>>>>>
>>>>>>>>>> > >>>>>>>>> Best regards
> >>>>>>>>> Michael Bauer
> >>>>>>>>>

> >>>>>>>>>

>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>>>>>
>>>>>>>>>>> Hi Michael,
> >>>>>>>>>
>>>>>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>>>>>> instruction),
> >>>>>>>>> the
> >>>>>>>>>> test of this evening doesn't show this error anymore??? (During
> >>>>>>>>>> the
> >>>>>>>>> weekend
> >>>>>>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>>>>>> difference?)
> >>>>>>>>>
>>>>>>>>>>> The issue that I still have, is that the planning calendar has a
> >>>>>>>>>> copy
> >>>>>>>>>> of
> >>>>>>>>> the
> >>>>>>>>>> original and that I do not longer have the possibility to send

> the
> >>>>>>>>>> meeting
> >>>>>>>>>> request. I have really to send out the requests so that the
> >> involved
> >>>>>>>>>> employees are aware of it. But there is no need to keep all
> >>>>>>>>>> these
> >>>>>>>>>> requests
> >>>>>>>>>> in my calendar. Therefore, the checks to decide to keep it or to
> >>>>>>>>>> move
> >>>>>>> it.
> >>>>>>>>>
>>>>>>>>>>> I cannot use .send because I must be able to edit the message or
> >> add
> >>>>>>>>>> additional info before sending.
> >>>>>>>>>
>>>>>>>>>>> In Outlook 2003, the code below allowed to send the meeting
> >> request.
> >>>>>>>>>
>>>>>>>>>>> Does the .move insruction has now extra parameters to indicate a
> >>>>>>>>>> copy
> >>>>>>>>>> or
> >>>>>>>>>> a
> >>>>>>>>>> move?
> >>>>>>>>>
>>>>>>>>>>> With kind regards,
> >>>>>>>>>
>>>>>>>>>>> JP
> >>>>>>>>>
>>>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>>>>>
>>>>>>>>>>>> What's the error message, and where does it occur?
> >>>>>>>>>>
>>>>>>>>>>>> > >>>>>>>>>>> Best regards
> >>>>>>>>>>> Michael Bauer
> >>>>>>>>>>>

> >>>>>>>>>>>

>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>>>>>
>>>>>>>>>>>>> Hi All,
> >>>>>>>>>>>
>>>>>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh
> >>>>>>>>>>>> thanks
> >> to
> >>>>>>>>>>>> Bill,
> >>>>>>>>>>>> a
> >>>>>>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>>>>>
>>>>>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>>>>>> containing
> >>>>>>>>> all
> >>>>>>>>>>>> teammembers with their daily schedule (they are working 24/24
> >>>> -7/7).
> >>>>>>>>>>>> I
> >>>>>>>>>>> build
> >>>>>>>>>>>> some code in Excel to create tasks or meetingrequests to

> assign
> >>>>>>>>>>>> tasks
> >>>>>>>>> to
> >>>>>>>>>>> my
> >>>>>>>>>>>> team.
> >>>>>>>>>>>
>>>>>>>>>>>>> The purpose of the meetingrequests is not that I want to see
> >>>>>>>>>>>> them
> >>>>>>>>>>>> but
> >>>>>>>>>>>> to
> >>>>>>>>>>>> inform them that they have a special task to do or to follow

> up.
> >>>>>>>>>>> Therefore,
> >>>>>>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>>>>>> calendar
> >>>>>>>>>>>> and
> >>>>>>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>>>>>
>>>>>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>>>>>> meetingrequest
> >>>>>>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>>>>>
>>>>>>>>>>>>> With kind regards,
> >>>>>>>>>>>
>>>>>>>>>>>>> JP
> >>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>>>>>
>>>>>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>>>>>> Set myAppointments =
> >>>>>>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>>>>>> End Sub
> >>>>>>>>>>>
>>>>>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>>>>>> Dim strSubject As String
> >>>>>>>>>>>> Dim intRecipients As Integer
> >>>>>>>>>>>> Dim varEntryID As Variant
> >>>>>>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>>>>>> Dim MyPlanningItem As String
> >>>>>>>>>>>
>>>>>>>>>>>>> '''Stop
> >>>>>>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>>>>>> '''blnPlanning = False
> >>>>>>>>>>>
>>>>>>>>>>>>> Set MyItem = Item
> >>>>>>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>>>>>
>>>>>>>>>>>>> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox

> -
> >>>>>>>>> Degroote
> >>>>>>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>>>>>
>>>>>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>>>>>> ''' check item
> >>>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>>> Else
> >>>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>>> End If
> >>>>>>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>>>>>
>>>>>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved

> to
> >>>>>>>>> planning
> >>>>>>>>>>>> calendar
> >>>>>>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>>>>>> Degroote"
> >>>>>>>>>>>> Or
> >>>>>>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*"

> Or
> >>>>>>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*"
> >> Then
> >>>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>>> Exit For
> >>>>>>>>>>>> End If
> >>>>>>>>>>>> Next intRecipients
> >>>>>>>>>>>
>>>>>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>> With MyItem
> >>>>>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>>>>> .ResponseRequested = False
> >>>>>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>>>>> .Close olDiscard
> >>>>>>>>>>>> End With
> >>>>>>>>>>>> End If
> >>>>>>>>>>>
>>>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>>>>> MyItem.Display
> >>>>>>>>>>>> End If
> >>>>>>>>>>>
>>>>>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>>>>>
>>>>>>>>>>>>> On Error GoTo 0
> >>>>>>>>>>>> Exit Sub
> >>>>>>>>>>>
>>>>>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>>>>>> Select Case Err.Number
> >>>>>>>>>>>> Case -2147221233
> >>>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>>> '''For intRecipients = 1 To
> >>>>>>>>>>>> MyItem.Recipients.Count
> >>>>>>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>>>>>> ''' Exit For
> >>>>>>>>>>>> ''' Else
> >>>>>>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>>>>>> ''' Exit For
> >>>>>>>>>>>> ''' End If
> >>>>>>>>>>>> '''Next intRecipients
> >>>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>>>>>> End If
> >>>>>>>>>>>> End If
> >>>>>>>>>>>> '''MyItem.Display
> >>>>>>>>>>>> Set MyItem = Nothing
> >>>>>>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>>>>>> Case Else
> >>>>>>>>>>>> MsgBox prompt:="An error occured.",
> >>>>>>>>>>>> Title:="Warning",
> >>>>>>>>>>>> Buttons:=vbOKOnly
> >>>>>>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>>>>>> End Select
> >>>>>>>>>>>> End Sub
> >>>>>
>>>>>>>
 
J

JP Ronse

Hi Michael,

Finally, I could resolve the issue. It looks as Outlook 2007 moves a meeting

item as appointment item.

Following code works.

strSubject = Item.Subject

Set MyItem = Item.Move(fldPlanningCalendar)

With MyItem

=> .MeetingStatus = olMeeting ''' regenerate a meetig item

> Subject = strSubject ''' to remove 'Copy' in subject

> Display

End With

With kind regards and again thanks for your assistance,

JP

"JP Ronse" <fb893760@skynet.be> wrote in message

news:%23Q7FWVPyKHA.5776@TK2MSFTNGP06.phx.gbl...
> Hi Michael,

> Sorry, I've tried your suggestion but did not get the expected result.

> With following code:

> Public WithEvents myAppointments As Outlook.Items

> Private Sub Application_Startup()
> Set myAppointments =
> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> End Sub

> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote
> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

> Set MyItem = Item
> MyItem.Close olSave
> DoEvents
> Set MyItem = MyItem.Move(fldPlanningCalendar)
> MyItem.Display

> End Sub

> The meetingItem is now a copy of the original which I can't send.

> Changing the code a bit (marked with ***)
> Set fldPlanningCalendar = Outlook.Session.Folders("Mailbox - Degroote
> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")

> Set MyItem = Item
> MyItem.Close olSave
> DoEvents
> *** MyItem.Move (fldPlanningCalendar)
> MyItem.Display

> Gives run-time error 424, change:

> MyItem.Move (fldPlanningCalendar) to MyItem.Move fldPlanningCalendar

> Now the meetingItem is opened and the send button is available.

> Click Send => "The operation cannot be performed because the object has
> been deleted."

> There are no other errors trapped.

> With kind regards,

> JP

> "Michael Bauer " <mb@mvps.org> wrote in message
> news:14hpzczz9e1l8.e8eno0a7drnd.dlg@40tude.net...
>

>
>> I don't see that you've tried my suggestion. Again, check for errors
> > please
> > and tell us what happens.
>

>> > > Best regards
> > Michael Bauer
> >

> >

>
>
>> Am Tue, 16 Mar 2010 17:51:48 +0100 schrieb JP Ronse:
> >
> >> An idea how to force move then with VBA?
> >
>>
>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >> news:1w6wxsvcktjtp$.1tcj4vevsvkgj$.dlg@40tude.net...
> >>
>>>
>>>> My guess: The default has changed, now it's Copy.
> >>
>>>> > >>> Best regards
> >>> Michael Bauer
> >>>

> >>>

>>>
>>>
>>>> Am Mon, 15 Mar 2010 19:51:29 +0100 schrieb JP Ronse:
> >>
>>>>> Hi Michael,
> >>>
>>>>> No, I dragged with the left mouse button, trying it with the right
> >>>> mouse
> >>>> button gives indeed the options to copy or move. The "move" is then
> >>>> correctly executed.
> >>>
>>>>
>>>>> So the question remains why .move creates a copy instead of doing the
> >>> move?
> >>>
>>>>> Should I close the item before using .move?
> >>>
>>>>> With kind regards,
> >>>
>>>>> J¨P
> >>>
>>>>
>>>>
>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>> news:12zzu4v5tjdvf.1hprwq7ioq93.dlg@40tude.net...
> >>>>
>>>>>
>>>>>> Have you tried to drag with the right mouse button, then choose Move
> >>>>> instead
> >>>>> of Copy?
> >>>>
>>>>>> > >>>>> Best regards
> >>>>> Michael Bauer
> >>>>>

> >>>>>

>>>>>
>>>>>
>>>>>> Am Sun, 14 Mar 2010 16:34:43 +0100 schrieb JP Ronse:
> >>>>
>>>>>>> Hi Michael,
> >>>>>
>>>>>>> It is not working like I want and I don't get it fixed.
> >>>>>
>>>>>>> The behaviour of Outlook 2007 differs from 2003. When dragging an
> >>>>>> appointment to another calendar, Outlook 2007 makes a copy of the
> >>>>>> appointment and keeps the original in the calendar. Furthermore it
> >>>>>> is
> >>> not
> >>>>>> possible to send the copy.
> >>>>>
>>>>>>
>>>>>>> Witk kind regards,
> >>>>>
>>>>>>> JP
> >>>>>
>>>>>>
>>>>>>
>>>>>>> "JP Ronse" <fb893760@skynet.be> wrote in message
> >>>>>> news:e204l%23HwKHA.1984@TK2MSFTNGP05.phx.gbl...
> >>>>>>> Hi Michael,
> >>>>>>
>>>>>>>> Thanks for your input, I'll try your suggestion this weekend and
> >>>>>>> keep
> >>>>>>> you
> >>>>>>> posted about the result.
> >>>>>>
>>>>>>>> With kind regards,
> >>>>>>
>>>>>>>> JP
> >>>>>>
>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>> news:1gbtnucp0p23e.10ef4h19u2vil.dlg@40tude.net...
> >>>>>>>
>>>>>>>>
>>>>>>>>> You can see all of the available events in the object browser
> >>>>>>>> (f2),
> >>>>>>>> there's
> >>>>>>>> also a Close event. But as I see it, you don't need that. Please
> >>>>>>>> try
> >>> my
> >>>>>>>> suggestion:
> >>>>>>>
>>>>>>>>> myitem.close oldiscard
> >>>>>>>> DoEvents
> >>>>>>>> set myitem=myitem.move(whereever)
> >>>>>>>> myitem.display
> >>>>>>>
>>>>>>>>> If the item doesn't get displayed, there must be an error, which
> >>>>>>>> you
> >>>>> have
> >>>>>>>> to
> >>>>>>>> catch in your error handler.
> >>>>>>>
>>>>>>>>> > >>>>>>>> Best regards
> >>>>>>>> Michael Bauer
> >>>>>>>>

> >>>>>>>>

>>>>>>>>
>>>>>>>>
>>>>>>>>> Am Tue, 9 Mar 2010 20:10:28 +0100 schrieb JP Ronse:
> >>>>>>>
>>>>>>>>>> Hi Michael,
> >>>>>>>>
>>>>>>>>>> My problem is with the following code lines:
> >>>>>>>>
>>>>>>>>>> Creating a meeting request fires the ItemAdd event
> >>>>>>>>
>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>> With MyItem
> >>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>> .ResponseRequested = False
> >>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>> .Close olDiscard
> >>>>>>>>> End With
> >>>>>>>>> End If
> >>>>>>>>
>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>> MyItem.Display
> >>>>>>>>> End If
> >>>>>>>>
>>>>>>>>>> With blnPlanning I find out if I want to keep this meeting
> >>>>>>>>> request
> >>>>>>>>> in
> >>>>> my
> >>>>>>>> own
> >>>>>>>>> calendar or not. What was working in Outlook 2003 is moving the

> > item
> >>>>>>>>> to
> >>>>>>>> the
> >>>>>>>>> other calendar but because I still had to send it, it recalled it
> >>> form
> >>>>>>>>> the
> >>>>>>>>> other calendar with .GetLast.
> >>>>>>>>
>>>>>>>>>> In outlook 2007, the moved item is a copy of the original and so
> >>>>>>>>> I
> >>>>>>>>> cannot
> >>>>>>>>> send it anymore to the recipients.
> >>>>>>>>
>>>>>>>>>> A workaround could be sending and closing the item first and move

> > it
> >>>>>>>>> them
> >>>>>>>> as
> >>>>>>>>> you suggest.
> >>>>>>>>
>>>>>>>>>> Is there an ItemClose event and is it fired by sending the
> >>>>>>>>> request?
> >>>>>>>>
>>>>>>>>>> Many, many thanks for your time and assistance.
> >>>>>>>>
>>>>>>>>>> With kind regards,
> >>>>>>>>
>>>>>>>>>> JP
> >>>>>>>>
>>>>>>>>>
>>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>>> news:zxelhboolj9g.3xbdu69hs2o6.dlg@40tude.net...
> >>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> It's hard for me to follow what your question is. However, as to
> >>> your
> >>>>>>>>>> code:
> >>>>>>>>>> Assuming the item is open, I'd first close and then move it. The
> >>> Move
> >>>>>>>>>> function returns the moved item, so there's no need to work with
> >>>>>>>>>> the
> >>>>>>>>>> GetLast
> >>>>>>>>>> function.
> >>>>>>>>>
>>>>>>>>>>> If the moved item isn't displayed, the should be an error. Your
> >>> error
> >>>>>>>>>> handler is quite meaningless for the Else case. I'd add
> >>>>> Err.Description
> >>>>>>>> to
> >>>>>>>>>> the prompt, so that you know which error occurs.
> >>>>>>>>>
>>>>>>>>>>> > >>>>>>>>>> Best regards
> >>>>>>>>>> Michael Bauer
> >>>>>>>>>>

> >>>>>>>>>>

>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Am Mon, 8 Mar 2010 19:59:57 +0100 schrieb JP Ronse:
> >>>>>>>>>
>>>>>>>>>>>> Hi Michael,
> >>>>>>>>>>
>>>>>>>>>>>> I got the error that the item was deleted (after the .move
> >>>>>>>>>>> instruction),
> >>>>>>>>>> the
> >>>>>>>>>>> test of this evening doesn't show this error anymore??? (During
> >>>>>>>>>>> the
> >>>>>>>>>> weekend
> >>>>>>>>>>> I was testing on-line, now off-line, perhaps this can make a
> >>>>>>>> difference?)
> >>>>>>>>>>
>>>>>>>>>>>> The issue that I still have, is that the planning calendar has
> >>>>>>>>>>> a
> >>>>>>>>>>> copy
> >>>>>>>>>>> of
> >>>>>>>>>> the
> >>>>>>>>>>> original and that I do not longer have the possibility to send

> > the
> >>>>>>>>>>> meeting
> >>>>>>>>>>> request. I have really to send out the requests so that the
> >>> involved
> >>>>>>>>>>> employees are aware of it. But there is no need to keep all
> >>>>>>>>>>> these
> >>>>>>>>>>> requests
> >>>>>>>>>>> in my calendar. Therefore, the checks to decide to keep it or
> >>>>>>>>>>> to
> >>>>>>>>>>> move
> >>>>>>>> it.
> >>>>>>>>>>
>>>>>>>>>>>> I cannot use .send because I must be able to edit the message
> >>>>>>>>>>> or
> >>> add
> >>>>>>>>>>> additional info before sending.
> >>>>>>>>>>
>>>>>>>>>>>> In Outlook 2003, the code below allowed to send the meeting
> >>> request.
> >>>>>>>>>>
>>>>>>>>>>>> Does the .move insruction has now extra parameters to indicate
> >>>>>>>>>>> a
> >>>>>>>>>>> copy
> >>>>>>>>>>> or
> >>>>>>>>>>> a
> >>>>>>>>>>> move?
> >>>>>>>>>>
>>>>>>>>>>>> With kind regards,
> >>>>>>>>>>
>>>>>>>>>>>> JP
> >>>>>>>>>>
>>>>>>>>>>>> "Michael Bauer " <mb@mvps.org> wrote in message
> >>>>>>>>>>> news:c3fnqg9c486x.1l0gaeflgawg1.dlg@40tude.net...
> >>>>>>>>>>>
>>>>>>>>>>>>> What's the error message, and where does it occur?
> >>>>>>>>>>>
>>>>>>>>>>>>> > >>>>>>>>>>>> Best regards
> >>>>>>>>>>>> Michael Bauer
> >>>>>>>>>>>>

> >>>>>>>>>>>>

>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> Am Sun, 7 Mar 2010 17:07:14 +0100 schrieb JP Ronse:
> >>>>>>>>>>>
>>>>>>>>>>>>>> Hi All,
> >>>>>>>>>>>>
>>>>>>>>>>>>>> I just made the upgrade from Office 2003 to 2007 and, oh
> >>>>>>>>>>>>> thanks
> >>> to
> >>>>>>>>>>>>> Bill,
> >>>>>>>>>>>>> a
> >>>>>>>>>>>>> lot of VBA-code is not working anymore.
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Let me first explain the context, I have an Exvel workbook
> >>>>>>>>>>>>> containing
> >>>>>>>>>> all
> >>>>>>>>>>>>> teammembers with their daily schedule (they are working 24/24
> >>>>> -7/7).
> >>>>>>>>>>>>> I
> >>>>>>>>>>>> build
> >>>>>>>>>>>>> some code in Excel to create tasks or meetingrequests to

> > assign
> >>>>>>>>>>>>> tasks
> >>>>>>>>>> to
> >>>>>>>>>>>> my
> >>>>>>>>>>>>> team.
> >>>>>>>>>>>>
>>>>>>>>>>>>>> The purpose of the meetingrequests is not that I want to see
> >>>>>>>>>>>>> them
> >>>>>>>>>>>>> but
> >>>>>>>>>>>>> to
> >>>>>>>>>>>>> inform them that they have a special task to do or to follow

> > up.
> >>>>>>>>>>>> Therefore,
> >>>>>>>>>>>>> I don't want to see it in my calendar. So, I created a second
> >>>>>>>>>>>>> calendar
> >>>>>>>>>>>>> and
> >>>>>>>>>>>>> move the appointment to this one, using the code below.
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Since the upgrade, it is still working, but I can't send the
> >>>>>>>>>>>> meetingrequest
> >>>>>>>>>>>>> anymore. Any help will be very appreciated.
> >>>>>>>>>>>>
>>>>>>>>>>>>>> With kind regards,
> >>>>>>>>>>>>
>>>>>>>>>>>>>> JP
> >>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Public WithEvents myAppointments As Outlook.Items
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Private Sub Application_Startup()
> >>>>>>>>>>>>> Set myAppointments =
> >>>>>>>>>>>>> Outlook.Session.GetDefaultFolder(olFolderCalendar).Items
> >>>>>>>>>>>>> End Sub
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Private Sub myAppointments_ItemAdd(ByVal Item As Object)
> >>>>>>>>>>>>> Dim MyItem As AppointmentItem
> >>>>>>>>>>>>> Dim blnPlanning As Boolean
> >>>>>>>>>>>>> Dim strSubject As String
> >>>>>>>>>>>>> Dim intRecipients As Integer
> >>>>>>>>>>>>> Dim varEntryID As Variant
> >>>>>>>>>>>>> Dim fldPlanningCalendar As Outlook.MAPIFolder
> >>>>>>>>>>>>> Dim MyPlanningItem As String
> >>>>>>>>>>>>
>>>>>>>>>>>>>> '''Stop
> >>>>>>>>>>>>> strSubject = "*Resource Reservation*"
> >>>>>>>>>>>>> '''blnPlanning = False
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Set MyItem = Item
> >>>>>>>>>>>>> MyItem.Recipients.ResolveAll
> >>>>>>>>>>>>> On Error GoTo Error_myPlanningAppointments
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Set fldPlanningCalendar =
> >>>>>>>>>>>>> Outlook.Session.Folders("Mailbox

> > -
> >>>>>>>>>> Degroote
> >>>>>>>>>>>>> Jean-Pierre (TEB/MST)").Folders("Planning Calendar")
> >>>>>>>>>>>>
>>>>>>>>>>>>>> ''' Planning Calendar exist
> >>>>>>>>>>>>> ''' check item
> >>>>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>>>> Else
> >>>>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>> '''MyItem.BusyStatus = olBusy
> >>>>>>>>>>>>
>>>>>>>>>>>>>> '''blnPlanning = True ''' means that meeting can be moved

> > to
> >>>>>>>>>> planning
> >>>>>>>>>>>>> calendar
> >>>>>>>>>>>>> For intRecipients = 1 To MyItem.Recipients.Count
> >>>>>>>>>>>>> If MyItem.Recipients(intRecipients) Like "Jean-Pierre
> >>>>>>>> Degroote"
> >>>>>>>>>>>>> Or
> >>>>>>>>>>>>> MyItem.Recipients(intRecipients) Like "Degroote Jean-Pierre*"

> > Or
> >>>>>>>>>>>>> MyItem.Recipients(intRecipients) Like "DEGROOTE Jean-Pierre*"
> >>> Then
> >>>>>>>>>>>>> blnPlanning = False
> >>>>>>>>>>>>> Exit For
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>> Next intRecipients
> >>>>>>>>>>>>
>>>>>>>>>>>>>> If MyItem.Recipients.Count = 0 Then blnPlanning = False
> >>>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>>> With MyItem
> >>>>>>>>>>>>> ''''.ReminderSet = False
> >>>>>>>>>>>>> .ResponseRequested = False
> >>>>>>>>>>>>> .Move fldPlanningCalendar
> >>>>>>>>>>>>> .Close olDiscard
> >>>>>>>>>>>>> End With
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>
>>>>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>>> Set MyItem = fldPlanningCalendar.Items.GetLast
> >>>>>>>>>>>>> MyItem.Display
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Exit_myPlanningAppointments:
> >>>>>>>>>>>>
>>>>>>>>>>>>>> On Error GoTo 0
> >>>>>>>>>>>>> Exit Sub
> >>>>>>>>>>>>
>>>>>>>>>>>>>> Error_myPlanningAppointments:
> >>>>>>>>>>>>> Select Case Err.Number
> >>>>>>>>>>>>> Case -2147221233
> >>>>>>>>>>>>> If MyItem.Subject Like strSubject Then
> >>>>>>>>>>>>> '''For intRecipients = 1 To
> >>>>>>>>>>>>> MyItem.Recipients.Count
> >>>>>>>>>>>>> ''' If MyItem.Organizer =
> >>>>>>>>>>>>> MyItem.Recipients(intRecipients) Then
> >>>>>>>>>>>>> ''' MyItem.BusyStatus = olBusy
> >>>>>>>>>>>>> ''' Exit For
> >>>>>>>>>>>>> ''' Else
> >>>>>>>>>>>>> ''' MyItem.BusyStatus = olFree
> >>>>>>>>>>>>> ''' Exit For
> >>>>>>>>>>>>> ''' End If
> >>>>>>>>>>>>> '''Next intRecipients
> >>>>>>>>>>>>> blnPlanning = True
> >>>>>>>>>>>>> If blnPlanning = True Then
> >>>>>>>>>>>>> MyItem.BusyStatus = olFree
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>> End If
> >>>>>>>>>>>>> '''MyItem.Display
> >>>>>>>>>>>>> Set MyItem = Nothing
> >>>>>>>>>>>>> Resume Exit_myPlanningAppointments:
> >>>>>>>>>>>>> Case Else
> >>>>>>>>>>>>> MsgBox prompt:="An error occured.",
> >>>>>>>>>>>>> Title:="Warning",
> >>>>>>>>>>>>> Buttons:=vbOKOnly
> >>>>>>>>>>>>> Resume Exit_myPlanningAppointments
> >>>>>>>>>>>>> End Select
> >>>>>>>>>>>>> End Sub
> >>>>>>
>>>>>>>>


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Upgrade 2003 BCM to 2007 BCM BCM (Business Contact Manager) 3
T Custom form created in 2003 won't print since upgrade to 2007 Outlook VBA and Custom Forms 1
T Custom form created in 2003 won't print since upgrade to 2007 Outlook VBA and Custom Forms 13
B Upgrade 2003 to 2010 and max pst file size of 2GB Using Outlook 2
P Outlook 2002 - How to upgrade to 2003 and convert PST from ANSI to Unicode? Using Outlook 7
e_a_g_l_e_p_i I think it may be time to upgrade from Outlook 2010 Using Outlook 3
T upgrade from outlook.com to Outlook Using Outlook 2
D iCloud Add-in not working in Outlook 2013 and Outlook 2016 After Windows Upgrade & iCloud Upgrade Using Outlook 2
T How do I upgrade from outlook.com to Outlook? Using Outlook 5
T Many problems with outlook.com - will upgrade to Outlook soon Using Outlook 1
L Upgrade from Outlook 2010-any reason to? Using Outlook 1
M re-Attaching PSTs after upgrade to 2016 Using Outlook 0
M Upgrade in Progress. Your mailbox is currently being optimized as part of upgrade to Outlook 2010 Using Outlook 9
E Upgrade Issues - Office/Outlook 2007 to 2010 Using Outlook 0
A Upgrade BCM System from 2010 to 2013 BCM (Business Contact Manager) 0
Diane Poremsky How to Upgrade to Color Categories Using Outlook 0
P Outlook 2013 search broken after upgrade from 2010 Using Outlook 0
W Outlook 2013 - 2nd acct stopped receiving email after Win 8.1 upgrade Using Outlook 3
U BCM upgrade help BCM (Business Contact Manager) 0
F Which upgrade should I go for and how do I do it please? Using Outlook 2
H Outlook 2010 unable to send iCloud account e-mail after iOS 7 upgrade Using Outlook 12
B Two Inboxes after upgrade, how to merge? Using Outlook 4
L Outlook 2002-2013 upgrade Using Outlook 3
Horsepower Upgrade advice needed Using Outlook 3
T Outlook 2010 keeps asking password after upgrade Exchange Server Administration 1
S Upgrade Outlook 2007 to outlook with Buisiness Contact m|Manger BCM (Business Contact Manager) 2
E How to restore BCM Database after upgrade from Vista to Win7? BCM (Business Contact Manager) 1
B Upgrade to 2007, Action stopped working Outlook VBA and Custom Forms 3
A Upgrade to 2007, lost 'Accounts' info BCM (Business Contact Manager) 1
J BCM no longer loads sqlserver after SP2 upgrade BCM (Business Contact Manager) 2
glnz Moving from Outlook 2003 to MS365 Outlook - need basics Using Outlook 4
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
B Outlook 2003 email sending & receiving suddenly stopped working Using Outlook 3
H Outlook 2003 find by "has attachment" Using Outlook 1
glnz How set up new IMAP on Outlook-Office 365 and merge in pst from Outlook 2003 for same two email accounts? Using Outlook 5
P Import Categories from Outlook 2003 Using Outlook 8
V Outlook 2003 problem with Windows 10 Creators Update 1709 Using Outlook 0
M Outlook 2003 pictures - some visible, some not Using Outlook 0
S Outlook 2003 to Outlook 2013 pst file Using Outlook 5
O Memory Leak in Outlook 2003 Using Outlook 3
B 2013 to 2003 Exchange Server Administration 0
W Changing looks of emails in Outlook 2003 Using Outlook 0
O Outlook 2003 can't send, but settings seem OK Using Outlook 1
P URL Hyperlink not working correctly in Outlook 2003 Using Outlook 10
C 2003 OL to OneDrive People Using Outlook 1
O Outlook 2003 can't open contacts. Using Outlook 2
J Using 2003 .pst files w 2013 Using Outlook 1
O Promoting Outlook 2003 User Templates Using Outlook 1
M Can't open .pst file in Office 2003. Using Outlook 2
O W-a-a-y too many PSTs (Outlook 2003) Using Outlook 0

Similar threads

Top