To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=87741
                 Issue #|87741
                 Summary|Macros not accessible in form opened from external doc
                        |ument
               Component|Database access
                 Version|OOo 2.4.0
                Platform|PC
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|none
             Assigned to|dbaneedsconfirm
             Reported by|cianoz





------- Additional comments from [EMAIL PROTECTED] Wed Apr  2 13:02:27 +0000 
2008 -------
I created a form in a Base document (.odb). I also created a couple of Basic
macros in this form and assigned them to some buttons.

I created a button in other documents (Calc and Writer docs) with a macro
assigned that opens directly the form contained in the Base file.

With OOo version 2.3.1 and previous I get all my macros available and running
from within the Form when i open it form the external files. Now with ver 2.4.0
I can still open the Form but all macros are "lost", I can't see them at all as
the Form doesn't contain them anymore.

If I open the orginal Base (.odb) file that contains the Form and run it from
within the Base file then all macros are still available and usable.

I made some check to Security settings and tried both from network paths and
local paths, with any result.

This is the macro is created for the external form loading (the one I use with a
button from external documents):


'------------------------------------------------

Sub ApriFormSchedaFornitore

Dim DatabaseContext as Object
Dim DataSource as Object
Dim Doc as Object
Dim Form as Object
Dim oFormDoc as Object
Dim Forms
Dim oParms(1) As New com.sun.star.beans.PropertyValue
Dim I as Integer
Dim names
Dim dbExists as Boolean
Dim subjectDb
Dim oCon as Object

subjectDb="schede_fornitori"

 If SwitchBoardOpen=True Then
   Exit Sub
   Else
   SwitchBoardOpen=true
   End If

' First look up the registered databases
DatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
Names=DatabaseContext.getElementNames()
dbExists=FALSE
' Now check to make sure the one we want is there.
For I = 0 To UBound(Names())
If names(I)=subjectDb Then
dbExists=TRUE
EndIf
Next
If dbExists=True then
' msgbox("Database " & subjectDb & " Found")
Else
msgbox("Error: Unable to locate " & subjectDb & " Database")
Exit Sub
Endif
'XRay.XRay DatabaseContext
' Now go to that database and open the form we expect to be there
ON Error GOTO OpenPhoneBookError
DataSource=DatabaseContext.getByName(subjectDb)
Doc=DataSource.DatabaseDocument
Forms=Doc.GetFormDocuments
Form=Forms.getByName("scheda_fornitore")
oCon = DataSource.getConnection("", "")
oParms(0).Name = "ActiveConnection"
oParms(0).Value = oCon
oParms(1).Name = "OpenMode"
oParms(1).Value = "open"
oFormDoc = Forms.loadComponentFromURL("scheda_fornitore", "", 0, oParms())

Exit Sub
OpenPhoneBookError:
msgbox("Error Occurred"& Err & Error$ & Erl )

On Error Goto 0
End Sub

'------------------------------------------------

I made no changes to the macro and to any files, all is the same before and
after I installed the 2.4.0 version. Simply, something in OOo has changed with
regard or this.

Could anyone confirm if this has a solution or workaround?
Thank you

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to