Problems post OfficeXP SP3

R

Roy Hill

Dear All,

I'm running a form I wrote some years ago and its not working any more
following a installation of Office SP3 not sure if its related anyhows...

The code is below and the error is where the line reposible for closing the
original form is invoked. The error message is "Window is diabled: Cannot
close. Check your code at line 51"

Line 51 is "Item.close(1)"

Any Help would be appreciated.

Best regards,
Roy.



Function Item_Send()

'***************************************************************************
***************************************
' get the form that we are going to copy data to and assign it to the
CCFform object.

Set MyNameSpace = Application.GetNameSpace("MAPI")
Set PublicFolder = MyNameSpace.Folders("Public Folders")
Set AllPublicFolder = PublicFolder.Folders("All Public Folders")
Set IGERPublicFolder = AllPublicFolder.Folders("IGER Public
Folders")
Set ComputingPublicFolder = IGERPublicFolder.Folders("Computing
Internal")
Set CCFfolder = ComputingPublicFolder.Folders("CCF")
Set CCFform = CCFfolder.Items.Add("IPM.Note.CCF-5")

'***************************************************************************
***************************************
' Copy the data from the opened CCF form (The one running this code) to
the CCFform form and then send the hidden
' form (CCFform form)

CCFform.Subject = "CCF: "+[Subject]
CCFform.To = [To]
CCFform.UserProperties.Find("TWSite").Value =
Item.UserProperties.Find("TWSite").Value
CCFform.UserProperties.Find("WPsite").Value =
Item.UserProperties.Find("WPsite").Value
CCFform.UserProperties.Find("NWsite").Value =
Item.UserProperties.Find("NWsite").Value
CCFform.UserProperties.Find("BMsite").Value =
Item.UserProperties.Find("BMsite").Value
CCFform.UserProperties.Find("Alls").Value =
Item.UserProperties.Find("Alls").Value
CCFform.UserProperties.Find("WANs").Value =
Item.UserProperties.Find("WANs").Value
CCFform.UserProperties.Find("LANse").Value =
Item.UserProperties.Find("LANse").Value
CCFform.UserProperties.Find("IntranetS").Value =
Item.UserProperties.Find("IntranetS").Value
CCFform.UserProperties.Find("InternetS").Value =
Item.UserProperties.Find("InternetS").Value
CCFform.UserProperties.Find("Unix/Mobics").Value =
Item.UserProperties.Find("Unix/Mobics").Value
CCFform.UserProperties.Find("DesktopS").Value =
Item.UserProperties.Find("DesktopS").Value
CCFform.UserProperties.Find("VaxS").Value =
Item.UserProperties.Find("VaxS").Value
CCFform.UserProperties.Find("FlerS").Value =
Item.UserProperties.Find("FlerS").Value
CCFform.UserProperties.Find("BackupS").Value =
Item.UserProperties.Find("BackupS").Value
CCFform.UserProperties.Find("OtherServices Effected").Value =
Item.UserProperties.Find("OtherServices Effected").Value
CCFform.UserProperties.Find("ChangeInput").Value =
Item.UserProperties.Find("ChangeInput").Value
CCFform.UserProperties.Find("PeriodChange").Value =
Item.UserProperties.Find("PeriodChange").Value
CCFform.UserProperties.Find("TickNumber").Value =
Item.UserProperties.Find("TickNumber").Value
CCFform.UserProperties.Find("ChangeNature").Value =
Item.UserProperties.Find("ChangeNature").Value
CCFform.UserProperties.Find("DocChanges").Value =
Item.UserProperties.Find("DocChanges").Value
CCFform.UserProperties.Find("Docs Location").Value =
Item.UserProperties.Find("Docs Location").Value
CCFform.UserProperties.Find("Mail message").Value =
Item.UserProperties.Find("Mail message").Value
CCFform.UserProperties.Find("NT Message Sent to Users").Value =
Item.UserProperties.Find("NT Message Sent to Users").Value
CCFform.UserProperties.Find("Message sent at all").Value =
Item.UserProperties.Find("Message sent at all").Value

CCFform.Send


'***************************************************************************
***************************************
' Set the opened form Send status to false this will ensure that the
opened form is not actually sent.
' Then close the original opened form.

Item_Send=False
Item.close(1)

'***************************************************************************
***************************************

' Set all MAPI resources free
Set MyNameSpace = Nothing
Set PublicFolder = Nothing
Set AllPublicFolder = Nothing
Set IGERPublicFolder = Nothing
Set ComputingPublicFolder = Nothing
Set CCFfolder = Nothing
Set CCFform = Nothing


'***************************************************************************
***************************************
'The End.

End Function

'***************************************************************************
***************************************
Sub Browse_click()
Dim strPath 'module level variable
Dim oPage
Dim oControl
'On Error Resume Next
Set oPage = Item.GetInspector.ModifiedFormPages("Details")
Set oControl = oPage.Controls("CommonDialog1")
oControl.ShowOpen
strPath=oPage.Controls("CommonDialog1").FileName
If strPath = "" Then
'no file chosen
Else
Item.UserProperties.Find("Docs Location").Value=strPath
End If
Err.Clear
End Sub
 
R

Roy Hill

Sorry about the bad formatting....

I did format it, but its all lost .........


;-)

Best regards
Roy

Roy Hill said:
Dear All,

I'm running a form I wrote some years ago and its not working any more
following a installation of Office SP3 not sure if its related anyhows...

The code is below and the error is where the line reposible for closing the
original form is invoked. The error message is "Window is diabled: Cannot
close. Check your code at line 51"

Line 51 is "Item.close(1)"

Any Help would be appreciated.

Best regards,
Roy.



Function Item_Send()

'***************************************************************************
***************************************
' get the form that we are going to copy data to and assign it to the
CCFform object.

Set MyNameSpace = Application.GetNameSpace("MAPI")
Set PublicFolder = MyNameSpace.Folders("Public Folders")
Set AllPublicFolder = PublicFolder.Folders("All Public Folders")
Set IGERPublicFolder = AllPublicFolder.Folders("IGER Public
Folders")
Set ComputingPublicFolder = IGERPublicFolder.Folders("Computing
Internal")
Set CCFfolder = ComputingPublicFolder.Folders("CCF")
Set CCFform = CCFfolder.Items.Add("IPM.Note.CCF-5")

'***************************************************************************
***************************************
' Copy the data from the opened CCF form (The one running this code) to
the CCFform form and then send the hidden
' form (CCFform form)

CCFform.Subject = "CCF: "+[Subject]
CCFform.To = [To]
CCFform.UserProperties.Find("TWSite").Value =
Item.UserProperties.Find("TWSite").Value
CCFform.UserProperties.Find("WPsite").Value =
Item.UserProperties.Find("WPsite").Value
CCFform.UserProperties.Find("NWsite").Value =
Item.UserProperties.Find("NWsite").Value
CCFform.UserProperties.Find("BMsite").Value =
Item.UserProperties.Find("BMsite").Value
CCFform.UserProperties.Find("Alls").Value =
Item.UserProperties.Find("Alls").Value
CCFform.UserProperties.Find("WANs").Value =
Item.UserProperties.Find("WANs").Value
CCFform.UserProperties.Find("LANse").Value =
Item.UserProperties.Find("LANse").Value
CCFform.UserProperties.Find("IntranetS").Value =
Item.UserProperties.Find("IntranetS").Value
CCFform.UserProperties.Find("InternetS").Value =
Item.UserProperties.Find("InternetS").Value
CCFform.UserProperties.Find("Unix/Mobics").Value =
Item.UserProperties.Find("Unix/Mobics").Value
CCFform.UserProperties.Find("DesktopS").Value =
Item.UserProperties.Find("DesktopS").Value
CCFform.UserProperties.Find("VaxS").Value =
Item.UserProperties.Find("VaxS").Value
CCFform.UserProperties.Find("FlerS").Value =
Item.UserProperties.Find("FlerS").Value
CCFform.UserProperties.Find("BackupS").Value =
Item.UserProperties.Find("BackupS").Value
CCFform.UserProperties.Find("OtherServices Effected").Value =
Item.UserProperties.Find("OtherServices Effected").Value
CCFform.UserProperties.Find("ChangeInput").Value =
Item.UserProperties.Find("ChangeInput").Value
CCFform.UserProperties.Find("PeriodChange").Value =
Item.UserProperties.Find("PeriodChange").Value
CCFform.UserProperties.Find("TickNumber").Value =
Item.UserProperties.Find("TickNumber").Value
CCFform.UserProperties.Find("ChangeNature").Value =
Item.UserProperties.Find("ChangeNature").Value
CCFform.UserProperties.Find("DocChanges").Value =
Item.UserProperties.Find("DocChanges").Value
CCFform.UserProperties.Find("Docs Location").Value =
Item.UserProperties.Find("Docs Location").Value
CCFform.UserProperties.Find("Mail message").Value =
Item.UserProperties.Find("Mail message").Value
CCFform.UserProperties.Find("NT Message Sent to Users").Value =
Item.UserProperties.Find("NT Message Sent to Users").Value
CCFform.UserProperties.Find("Message sent at all").Value =
Item.UserProperties.Find("Message sent at all").Value

CCFform.Send


'***************************************************************************
***************************************
' Set the opened form Send status to false this will ensure that the
opened form is not actually sent.
' Then close the original opened form.

Item_Send=False
Item.close(1)

'***************************************************************************
***************************************

' Set all MAPI resources free
Set MyNameSpace = Nothing
Set PublicFolder = Nothing
Set AllPublicFolder = Nothing
Set IGERPublicFolder = Nothing
Set ComputingPublicFolder = Nothing
Set CCFfolder = Nothing
Set CCFform = Nothing


'***************************************************************************
***************************************
'The End.

End Function

'***************************************************************************
***************************************
Sub Browse_click()
Dim strPath 'module level variable
Dim oPage
Dim oControl
'On Error Resume Next
Set oPage = Item.GetInspector.ModifiedFormPages("Details")
Set oControl = oPage.Controls("CommonDialog1")
oControl.ShowOpen
strPath=oPage.Controls("CommonDialog1").FileName
If strPath = "" Then
'no file chosen
Else
Item.UserProperties.Find("Docs Location").Value=strPath
End If
Err.Clear
End Sub
 
Top