1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3*3e02b54dSAndrew Rist<!--*********************************************************** 4*3e02b54dSAndrew Rist * 5*3e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 6*3e02b54dSAndrew Rist * or more contributor license agreements. See the NOTICE file 7*3e02b54dSAndrew Rist * distributed with this work for additional information 8*3e02b54dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 9*3e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the 10*3e02b54dSAndrew Rist * "License"); you may not use this file except in compliance 11*3e02b54dSAndrew Rist * with the License. You may obtain a copy of the License at 12*3e02b54dSAndrew Rist * 13*3e02b54dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 14*3e02b54dSAndrew Rist * 15*3e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing, 16*3e02b54dSAndrew Rist * software distributed under the License is distributed on an 17*3e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18*3e02b54dSAndrew Rist * KIND, either express or implied. See the License for the 19*3e02b54dSAndrew Rist * specific language governing permissions and limitations 20*3e02b54dSAndrew Rist * under the License. 21*3e02b54dSAndrew Rist * 22*3e02b54dSAndrew Rist ***********************************************************--> 23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Functions" script:language="StarBasic">REM ***** BASIC ***** 24cdf0e10cSrcweirDim DialogVisible As Boolean 25cdf0e10cSrcweirDim TutorStep As Integer 26cdf0e10cSrcweirDim TutorLastStep As Integer 27cdf0e10cSrcweirDim myDialog As Object 28cdf0e10cSrcweirDim myTutorial As Object 29cdf0e10cSrcweirPublic TutorText() As String 30cdf0e10cSrcweirDim documentTitle As String 31cdf0e10cSrcweirDim exampleUse As Object 32cdf0e10cSrcweirDim properties() As Object 33cdf0e10cSrcweirDim docTYP As String 34cdf0e10cSrcweir'public myWidth As Long 35cdf0e10cSrcweirDim myHeight As Long 36cdf0e10cSrcweirDim oTextField As Object 37cdf0e10cSrcweirDim stepTitle As String 38cdf0e10cSrcweirDim oOpenDialogFlag 39cdf0e10cSrcweirDim imageStatus As String 40cdf0e10cSrcweir 41cdf0e10cSrcweirSub LoadTutorialDialog(exampleToUse, documentTYP) 42cdf0e10cSrcweir Init() 43cdf0e10cSrcweir exampleUse = exampleToUse 44cdf0e10cSrcweir TutorText() = exampleUse.LoadText() 45cdf0e10cSrcweir properties() = exampleUse.GetProperties() 46cdf0e10cSrcweir If properties(3).Value = "True" Then 47cdf0e10cSrcweir Dim localisation(0) As new com.sun.star.beans.NamedValue 48cdf0e10cSrcweir localisation(0).Name = "Localisation" 49cdf0e10cSrcweir localisation(0).Value = properties() 50cdf0e10cSrcweir myTutorial.execute(localisation()) 51cdf0e10cSrcweir Else 52cdf0e10cSrcweir TutorStep = 0 53cdf0e10cSrcweir TutorLastStep = 0 54cdf0e10cSrcweir docTYP = documentTYP 55cdf0e10cSrcweir InitAction() 56cdf0e10cSrcweir ShowInfoMain() 57cdf0e10cSrcweir DialogVisible = True 58cdf0e10cSrcweir myDialog = LoadDialog("Tutorials","TutorialsDialog") 59cdf0e10cSrcweir 60cdf0e10cSrcweir SetTutorialDocumentPosSize() 61cdf0e10cSrcweir 62cdf0e10cSrcweir documentProps = ThisComponent.getDocumentProperties() 63cdf0e10cSrcweir myDialog.Title = "Tutorials - " & documentProps.Title 64cdf0e10cSrcweir oTextField = myDialog.GetControl("myTextField") 65cdf0e10cSrcweir oTextField.setVisible(False) 66cdf0e10cSrcweir 67cdf0e10cSrcweir imageStatus = "MIN" 68cdf0e10cSrcweir setMaxMinImage(imageStatus) 69cdf0e10cSrcweir 70cdf0e10cSrcweir 'myWidth = myDialog.Size.Width 71cdf0e10cSrcweir myHeight = myDialog.Size.Height 72cdf0e10cSrcweir 73cdf0e10cSrcweir CheckForStepShowButtonStatus() 74cdf0e10cSrcweir CheckForStepNextButtonStatus() 75cdf0e10cSrcweir InitRoadMap() 76cdf0e10cSrcweir SetVisibleTrue() 77cdf0e10cSrcweir myDialog.model.myTextField.Label = stepTitle 78cdf0e10cSrcweir myDialog.model.myText.Label = GetStepText()'TutorText(TutorStep) 79cdf0e10cSrcweir 80cdf0e10cSrcweir 81cdf0e10cSrcweir Do 82cdf0e10cSrcweir wait 1000 83cdf0e10cSrcweir Loop Until DialogVisible = False 84cdf0e10cSrcweir If( oOpenDialogFlag = True) Then 85cdf0e10cSrcweir Destroy() 86cdf0e10cSrcweir TutorialOpen.TutorialOpenMain() 87cdf0e10cSrcweir Else 88cdf0e10cSrcweir Destroy() 89cdf0e10cSrcweir End If 90cdf0e10cSrcweir End If 91cdf0e10cSrcweirEnd Sub 92cdf0e10cSrcweir 93cdf0e10cSrcweirSub setMaxMinImage(param As String) 94cdf0e10cSrcweir On Local Error Goto NOIMAGE 95cdf0e10cSrcweir oCommandButton = myDialog.GetControl("CommandButton") 96cdf0e10cSrcweir templatePath = GetPathSettings("Template",false, 0) 97cdf0e10cSrcweir Dim bitmapPath As String 98cdf0e10cSrcweir iPos = InStr(templatePath,"/") 99cdf0e10cSrcweir If(iPos > 0) Then 100cdf0e10cSrcweir If(param = "MAX") Then 101cdf0e10cSrcweir bitmapPath = templatePath & "../wizard/bitmap/maximize.bmp" 102cdf0e10cSrcweir ElseIf(param = "MIN") Then 103cdf0e10cSrcweir bitmapPath = templatePath & "../wizard/bitmap/minimize.bmp" 104cdf0e10cSrcweir End If 105cdf0e10cSrcweir Else 106cdf0e10cSrcweir If(param = "MAX") Then 107cdf0e10cSrcweir bitmapPath = templatePath & "..\wizard\bitmap\maximize.bmp" 108cdf0e10cSrcweir ElseIf(param = "MIN") Then 109cdf0e10cSrcweir bitmapPath = templatePath & "..\wizard\bitmap\minimize.bmp" 110cdf0e10cSrcweir End If 111cdf0e10cSrcweir End If 112cdf0e10cSrcweir 'printdbgInfo oCommandButton.Model 113cdf0e10cSrcweir oCommandButton.Model.ImageUrl = bitmapPath 114cdf0e10cSrcweir Exit Sub 115cdf0e10cSrcweir NOIMAGE: 116cdf0e10cSrcweirEnd Sub 117cdf0e10cSrcweir 118cdf0e10cSrcweirSub SetTutorialDocumentPosSize() 119cdf0e10cSrcweir activDesktopWindow = StarDesktop.activeFrame.ContainerWindow 120cdf0e10cSrcweir If(activDesktopWindow.posSize.Height < 550) Then 121cdf0e10cSrcweir activDesktopWindow.setPosSize(0,0,0,550,8) 122cdf0e10cSrcweir End If 123cdf0e10cSrcweir If (activDesktopWindow.posSize.Width < 750 ) Then 124cdf0e10cSrcweir activDesktopWindow.setPosSize(0,0,750,0,4) 125cdf0e10cSrcweir EndIf 126cdf0e10cSrcweirEnd Sub 127cdf0e10cSrcweir 128cdf0e10cSrcweirSub InitRoadMap() 129cdf0e10cSrcweir RoadMapMain(Functions, myDialog) 130cdf0e10cSrcweir SetControlModelPosSize(0, 0, 85, 176) 131cdf0e10cSrcweir SetControlModelText("Steps") 132cdf0e10cSrcweir 133cdf0e10cSrcweir StepSize = Ubound(TutorText()) 134cdf0e10cSrcweir Dim ItemsArray(StepSize) as String 135cdf0e10cSrcweir For i = 0 To StepSize 136cdf0e10cSrcweir stepcontent = TutorText(i) 137cdf0e10cSrcweir iPos = InStr(stepcontent,CHR(13)) 138cdf0e10cSrcweir ItemName = Left(stepcontent, iPos) 139cdf0e10cSrcweir ItemsArray(i) = ItemName 140cdf0e10cSrcweir Next i 141cdf0e10cSrcweir InsertItemsLabels( ItemsArray()) 142cdf0e10cSrcweir 143cdf0e10cSrcweir For i = 1 To StepSize 144cdf0e10cSrcweir SetItemEnabled( i, False) 145cdf0e10cSrcweir Next i 146cdf0e10cSrcweir SetItemEnabled( 0, True) 147cdf0e10cSrcweirEnd Sub 148cdf0e10cSrcweir 149cdf0e10cSrcweirSub Destroy() 150cdf0e10cSrcweir 'myDialog.dispose 151cdf0e10cSrcweir wait 1000 152cdf0e10cSrcweir ShowInfoDialog.DisposeIDialog() 153cdf0e10cSrcweir 154cdf0e10cSrcweir ' HIER WIRD DAS DOCUMENT GESCHLOSSEN!!!!!!!! GPF 155cdf0e10cSrcweir thisComponent.CurrentController.Frame.close(True) 156cdf0e10cSrcweir 157cdf0e10cSrcweirEnd Sub 158cdf0e10cSrcweir 159cdf0e10cSrcweirSub Init 160cdf0e10cSrcweir GlobalScope.BasicLibraries.LoadLibrary("Tools") 161cdf0e10cSrcweir myTutorial = createUNOService("com.sun.star.wizards.tutorial.executer.CallTutorialFramework") 162cdf0e10cSrcweir documentTitle = ThisComponent.getCurrentController.getFrame.Title 163cdf0e10cSrcweirEnd Sub 164cdf0e10cSrcweir 165cdf0e10cSrcweirSub InitStep 166cdf0e10cSrcweir udProps = ThisComponent.DocumentProperties.UserDefinedProperties 167cdf0e10cSrcweir If udProps.PropertySetInfo.hasPropertyByName("CurrentStep") Then 168cdf0e10cSrcweir TutorStep = udProps.CurrentStep 169cdf0e10cSrcweir Else 170cdf0e10cSrcweir udProps.addProperty("CurrentStep", 0, TutorStep) 171cdf0e10cSrcweir End If 172cdf0e10cSrcweirEnd Sub 173cdf0e10cSrcweir 174cdf0e10cSrcweirSub setStep 175cdf0e10cSrcweir ThisComponent.DocumentProperties.UserDefinedProperties.CurrentStep = TutorStep 176cdf0e10cSrcweirEnd Sub 177cdf0e10cSrcweir 178cdf0e10cSrcweirSub InitAction() 179cdf0e10cSrcweir SetStepTitle() 180cdf0e10cSrcweir 181cdf0e10cSrcweir Dim property(6) As new com.sun.star.beans.PropertyValue 182cdf0e10cSrcweir property(0).Name = "DocumentTYP" 183cdf0e10cSrcweir property(0).Value = docTYP 184cdf0e10cSrcweir property(1).Name = "MethodName" 185cdf0e10cSrcweir property(1).Value = "setDelay" 186cdf0e10cSrcweir property(2).Name = "Param" 187cdf0e10cSrcweir property(2).Value = 0 'key insert speed (Millis) 188cdf0e10cSrcweir property(3).Name = "Param" 189cdf0e10cSrcweir property(3).Value = 4 'mouse animate speed (Millis) 190cdf0e10cSrcweir property(4).Name = "Param" 191cdf0e10cSrcweir property(4).Value = 2000 'after mouse animate sleep (Millis) 192cdf0e10cSrcweir property(5).Name = "Param" 193cdf0e10cSrcweir property(5).Value = 10 'mouse scroll speed (Millis) 194cdf0e10cSrcweir property(6).Name = "Param" 195cdf0e10cSrcweir property(6).Value = -1 'mouse speed (step) 196cdf0e10cSrcweir myTutorial.setPropertyValues(property()) 197cdf0e10cSrcweirEnd Sub 198cdf0e10cSrcweir 199cdf0e10cSrcweirSub EndDialog 200cdf0e10cSrcweir oOpenDialogFlag = False 201cdf0e10cSrcweir If (myDialog.model.done.Label = "Close") Then 202cdf0e10cSrcweir TutorialCloseMain() 203cdf0e10cSrcweir Else 204cdf0e10cSrcweir DialogVisible = False 205cdf0e10cSrcweir End If 206cdf0e10cSrcweirEnd Sub 207cdf0e10cSrcweir 208cdf0e10cSrcweirSub NextStep 209cdf0e10cSrcweir GotoStep(TutorStep + 1) 210cdf0e10cSrcweirEnd Sub 211cdf0e10cSrcweir 212cdf0e10cSrcweirSub GotoStep(StepIndex) 213cdf0e10cSrcweir If(StepIndex <= Ubound(TutorText())) Then 214cdf0e10cSrcweir TutorStep = StepIndex 215cdf0e10cSrcweir If TutorStep > TutorLastStep Then 216cdf0e10cSrcweir TutorLastStep = TutorStep 217cdf0e10cSrcweir End If 218cdf0e10cSrcweir If(TutorStep = Ubound(TutorText())) Then 219cdf0e10cSrcweir myDialog.model.next.enabled = False 220cdf0e10cSrcweir myDialog.model.done.Label = "Done" 221cdf0e10cSrcweir myDialog.model.show.Label = "Tutorials" 222cdf0e10cSrcweir Else 223cdf0e10cSrcweir myDialog.model.next.enabled = True 224cdf0e10cSrcweir End If 225cdf0e10cSrcweir SetStepTitle() 226cdf0e10cSrcweir myDialog.model.myText.Label = GetStepText() 227cdf0e10cSrcweir CheckForStepShowButtonStatus() 228cdf0e10cSrcweir SetItemEnabled( TutorStep, True) 229cdf0e10cSrcweir 'setStep() 230cdf0e10cSrcweir End If 231cdf0e10cSrcweirEnd Sub 232cdf0e10cSrcweir 233cdf0e10cSrcweirFunction GetStepText() 234cdf0e10cSrcweir Dim tempText As String 235cdf0e10cSrcweir tempText = TutorText(TutorStep) 236cdf0e10cSrcweir iPos = InStr(tempText,CHR(13)) 237cdf0e10cSrcweir ResultString = Right(tempText, Len(tempText) - iPos - 1) 238cdf0e10cSrcweir GetStepText() = ResultString 239cdf0e10cSrcweirEnd Function 240cdf0e10cSrcweir 241cdf0e10cSrcweirSub ItemChange(CurrentItemID, SelectitemID) 242cdf0e10cSrcweir GotoStep(SelectitemID) 243cdf0e10cSrcweirEnd Sub 244cdf0e10cSrcweir 245cdf0e10cSrcweirSub SetDisableShowMeButton() 246cdf0e10cSrcweir myDialog.model.show.enabled = False 247cdf0e10cSrcweir TutorLastStep = TutorLastStep + 1 248cdf0e10cSrcweirEnd Sub 249cdf0e10cSrcweir 250cdf0e10cSrcweirSub Minimize(aEvent) 251cdf0e10cSrcweir ActionItemsTextField = myDialog.GetControl("ActionItemsLabel") 252cdf0e10cSrcweir FixedLineVertikal = myDialog.GetControl("FixedLineVertikal") 253cdf0e10cSrcweir 254cdf0e10cSrcweir If myDialog.Size.Height = 35 Then 255cdf0e10cSrcweir myDialog.setPosSize(0,0,0,myHeight,8) 256cdf0e10cSrcweir oTextField.setVisible(False) 257cdf0e10cSrcweir ActionItemsTextField.setVisible(True) 258cdf0e10cSrcweir FixedLineVertikal.setVisible(True) 259cdf0e10cSrcweir RoadMap.SetVisibleRoadMap(True) 260cdf0e10cSrcweir Else 261cdf0e10cSrcweir myDialog.setPosSize(0,0,0,35,8) 262cdf0e10cSrcweir rmSelectedIndex = RoadMap.GetSelectedIndex() + 1 263cdf0e10cSrcweir gsTitle = GetStepTitle() 264cdf0e10cSrcweir oTextField.setText(rmSelectedIndex & ". " & gsTitle) 265cdf0e10cSrcweir oTextField.setVisible(True) 266cdf0e10cSrcweir ActionItemsTextField.setVisible(False) 267cdf0e10cSrcweir FixedLineVertikal.setVisible(False) 268cdf0e10cSrcweir RoadMap.SetVisibleRoadMap(False) 269cdf0e10cSrcweir End If 270cdf0e10cSrcweir If(imageStatus = "MAX") Then 271cdf0e10cSrcweir imageStatus = "MIN" 272cdf0e10cSrcweir ElseIf(imageStatus = "MIN") Then 273cdf0e10cSrcweir imageStatus = "MAX" 274cdf0e10cSrcweir End If 275cdf0e10cSrcweir setMaxMinImage(imageStatus) 276cdf0e10cSrcweir 277cdf0e10cSrcweirEnd Sub 278cdf0e10cSrcweir 279cdf0e10cSrcweirSub SetStepTitle() 280cdf0e10cSrcweir stepcontent = TutorText(TutorStep) 281cdf0e10cSrcweir iPos = InStr(stepcontent,CHR(13)) 282cdf0e10cSrcweir stepTitle = Left(stepcontent, iPos) 283cdf0e10cSrcweir SetStepTitle() = stepTitle 284cdf0e10cSrcweirEnd Sub 285cdf0e10cSrcweir 286cdf0e10cSrcweirFunction GetStepTitle() 287cdf0e10cSrcweir GetStepTitle() = stepTitle 288cdf0e10cSrcweirEnd Function 289cdf0e10cSrcweir 290cdf0e10cSrcweirSub CheckForStepShowButtonStatus() 291cdf0e10cSrcweir If ((exampleUse.ContainsStepAction() = True And TutorStep = TutorLastStep) Or myDialog.model.show.Label = "Tutorials") Then 292cdf0e10cSrcweir myDialog.model.show.enabled = True 293cdf0e10cSrcweir Else 294cdf0e10cSrcweir myDialog.model.show.enabled = False 295cdf0e10cSrcweir End If 296cdf0e10cSrcweirEnd Sub 297cdf0e10cSrcweir 298cdf0e10cSrcweirSub CheckForStepNextButtonStatus() 299cdf0e10cSrcweir If(TutorStep = Ubound(TutorText())) Then 300cdf0e10cSrcweir myDialog.model.next.enabled = False 301cdf0e10cSrcweir myDialog.model.done.Label = "Done" 302cdf0e10cSrcweir End If 303cdf0e10cSrcweirEnd Sub 304cdf0e10cSrcweir 305cdf0e10cSrcweirSub Show(aEvent) 306cdf0e10cSrcweir 'ShowInfoMain() 307cdf0e10cSrcweir If( myDialog.model.show.Label = "Tutorials") Then 308cdf0e10cSrcweir oOpenDialogFlag = True 309cdf0e10cSrcweir DialogVisible = False 310cdf0e10cSrcweir Else 311cdf0e10cSrcweir SetMousePosition(aEvent) 312cdf0e10cSrcweir exampleUse.Action() 313cdf0e10cSrcweir End If 314cdf0e10cSrcweirEnd Sub 315cdf0e10cSrcweir 316cdf0e10cSrcweirSub SetMousePosition(aEvent) 317cdf0e10cSrcweir MyPoints() = MousePoints(aEvent) 318cdf0e10cSrcweir 319cdf0e10cSrcweir Dim mousePosition(3) as new com.sun.star.beans.PropertyValue 320cdf0e10cSrcweir mousePosition(0).Name = "DocumentTYP" 321cdf0e10cSrcweir mousePosition(0).Value = docTYP 322cdf0e10cSrcweir mousePosition(1).Name = "MethodName" 323cdf0e10cSrcweir mousePosition(1).Value = "setMousePosition" 324cdf0e10cSrcweir mousePosition(2).Name = "Param" 325cdf0e10cSrcweir mousePosition(2).Value = MyPoints(0) 326cdf0e10cSrcweir mousePosition(3).Name = "Param" 327cdf0e10cSrcweir mousePosition(3).Value = MyPoints(1) 328cdf0e10cSrcweir 329cdf0e10cSrcweir myTutorial.setPropertyValues(mousePosition()) 330cdf0e10cSrcweirEnd Sub 331cdf0e10cSrcweir 332cdf0e10cSrcweirFunction MousePoints(aEvent) 333cdf0e10cSrcweir Dim position(1) As Integer 334cdf0e10cSrcweir position(0) = myDialog.getControl("show").AccessibleContext.LocationOnScreen.X + aEvent.Source.Model.PositionX 335cdf0e10cSrcweir position(1) = myDialog.getControl("show").AccessibleContext.LocationOnScreen.Y + aEvent.Source.Model.PositionY 336cdf0e10cSrcweir MousePoints = position() 337cdf0e10cSrcweirEnd Function 338cdf0e10cSrcweir 339cdf0e10cSrcweirFunction CheckPath(path() As String) 340cdf0e10cSrcweir 'documentTitle = ThisComponent.getCurrentController.getFrame.Title 341cdf0e10cSrcweir sTitle = path(0) 342cdf0e10cSrcweir ResultString = Right(sTitle, 3) 343cdf0e10cSrcweir iPos = InStr(ResultString,"#") 344cdf0e10cSrcweir ResultString = Right(ResultString, Len(ResultString) - iPos) 345cdf0e10cSrcweir ResultFrameString = InStr (sTitle, "{D}FRAME#") 346cdf0e10cSrcweir If ResultFrameString <> 0 Then 347cdf0e10cSrcweir If Not (sTitle = ("{D}FRAME#" & documentTitle & "#" & ResultString)) Then 348cdf0e10cSrcweir 'path(0) = "{D}FRAME#" & documentTitle & "#" & ResultString 349cdf0e10cSrcweir path(0) = "FRAME#" & documentTitle & "#" & ResultString 350cdf0e10cSrcweir sTitle = path(1) 351cdf0e10cSrcweir ResultString = Right(sTitle, 3) 352cdf0e10cSrcweir iPos = InStr(ResultString,"#") 353cdf0e10cSrcweir ResultString = Right(ResultString, Len(ResultString) - iPos) 354cdf0e10cSrcweir path(1) = "ROOT_PANE#" & documentTitle & "#" & ResultString 355cdf0e10cSrcweir Else 356cdf0e10cSrcweir 'path(0) = "{D}FRAME#" & documentTitle & "#" & ResultString 357cdf0e10cSrcweir path(0) = "FRAME#" & documentTitle & "#" & ResultString 358cdf0e10cSrcweir End If 359cdf0e10cSrcweir End If 360cdf0e10cSrcweirEnd Function 361cdf0e10cSrcweir 362cdf0e10cSrcweirSub SetVisibleTutorialsDialog(param) 363cdf0e10cSrcweir myDialog.setVisible(param) 364cdf0e10cSrcweirEnd Sub 365cdf0e10cSrcweir 366cdf0e10cSrcweirSub SetVisibleTrue() 367cdf0e10cSrcweir myDialog.setVisible(True) 368cdf0e10cSrcweirEnd Sub 369cdf0e10cSrcweir 370cdf0e10cSrcweirSub SetVisibleFalse() 371cdf0e10cSrcweir myDialog.setVisible(False) 372cdf0e10cSrcweirEnd Sub 373cdf0e10cSrcweir 374cdf0e10cSrcweirSub ExitTutorial() 375cdf0e10cSrcweir Dim aUrl As new com.sun.star.util.URL 376cdf0e10cSrcweir oDoc = ThisComponent 377cdf0e10cSrcweir urlTransformer = createUNOService("com.sun.star.util.URLTransformer") 378cdf0e10cSrcweir aUrl.Complete = "slot:5621" 379cdf0e10cSrcweir urlTransformer.parseStrict(aUrl) 380cdf0e10cSrcweir xController = oDoc.getCurrentController() 381cdf0e10cSrcweir xDispatcher = xController.queryDispatch(aUrl, "", 0) 382cdf0e10cSrcweir if NOT isNull(xDispatcher) then 383cdf0e10cSrcweir xDispatcher.dispatch(aUrl, DimArray()) 384cdf0e10cSrcweir else 385cdf0e10cSrcweir msgBox "Error! Cannot close document." 386cdf0e10cSrcweir End If 387cdf0e10cSrcweirEnd Sub 388cdf0e10cSrcweir</script:module> 389