11ecadb57SMathias Bauer<?xml version="1.0" encoding="UTF-8"?> 21ecadb57SMathias Bauer<!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 ***********************************************************--> 231ecadb57SMathias Bauer<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Embed" script:language="StarBasic">' *** MODULE EMBED *** 241ecadb57SMathias Bauer 251ecadb57SMathias BauerDim oDialog AS Object 261ecadb57SMathias BauerDim oBrowseDialog As Object 271ecadb57SMathias BauerDim document AS Object 281ecadb57SMathias BauerDim arParas(0) As String 291ecadb57SMathias BauerDim arSecs(0) As String 301ecadb57SMathias BauerDim arVars(0) As String 311ecadb57SMathias Bauer 321ecadb57SMathias Bauer'======================================================= 331ecadb57SMathias Bauer' Main 341ecadb57SMathias Bauer'------------------------------------------------------- 351ecadb57SMathias Bauer' Embeds a variable or a section 361ecadb57SMathias Bauer'======================================================= 371ecadb57SMathias BauerSub Main(optional bCR As Boolean) 381ecadb57SMathias Bauer 391ecadb57SMathias Bauer If not IsHelpFile Then 401ecadb57SMathias Bauer msgbox(strErr_NoHelpFile) 411ecadb57SMathias Bauer Exit Sub 421ecadb57SMathias Bauer End If 431ecadb57SMathias Bauer 441ecadb57SMathias Bauer GlobalScope.BasicLibraries.loadLibrary("Tools") 451ecadb57SMathias Bauer 461ecadb57SMathias Bauer document = StarDesktop.CurrentComponent 471ecadb57SMathias Bauer 481ecadb57SMathias Bauer BasicLibraries.LoadLibrary("HelpAuthoring") 491ecadb57SMathias Bauer oDialog = LoadDialog("HelpAuthoring", "dlgEmbed") 501ecadb57SMathias Bauer oDialogModel = oDialog.Model 511ecadb57SMathias Bauer 521ecadb57SMathias Bauer oTxtFilePath = oDialog.GetControl("txtFilePath") ' path to file, rel to Docroot 531ecadb57SMathias Bauer oTxtID = oDialog.GetControl("txtID") ' anchor 541ecadb57SMathias Bauer oTxtHidFName = oDialog.GetControl("txtHidFName") ' pure filename 551ecadb57SMathias Bauer oOpVariable = oDialog.GetControl("opVariable") 561ecadb57SMathias Bauer oOpSection = oDialog.GetControl("opSection") 571ecadb57SMathias Bauer 581ecadb57SMathias Bauer DocRoot = ReadConfig("HelpPrefix") 591ecadb57SMathias Bauer EmbedFolder = ReadConfig("LastEmbedDir") 601ecadb57SMathias Bauer EmbedFile = ReadConfig("LastEmbedFile") 611ecadb57SMathias Bauer EmbedID = ReadConfig("LastEmbedAnchor") 621ecadb57SMathias Bauer EmbedType = ReadConfig("LastEmbedType") 631ecadb57SMathias Bauer If EmbedType = "Variable" Then 641ecadb57SMathias Bauer oOpVariable.State = TRUE 651ecadb57SMathias Bauer Else 661ecadb57SMathias Bauer oOpVariable.State = FALSE 671ecadb57SMathias Bauer End If 681ecadb57SMathias Bauer SetLabel 691ecadb57SMathias Bauer 701ecadb57SMathias Bauer If IsSubDir(EmbedFolder,DocRoot) Then 711ecadb57SMathias Bauer RelDir = Right(EmbedFolder,Len(EmbedFolder)-Len(DocRoot)) 721ecadb57SMathias Bauer If Dir(DocRoot+RelDir+EmbedFile) > "" Then 731ecadb57SMathias Bauer oTxtFilePath.Text = RelDir+EmbedFile 741ecadb57SMathias Bauer oTxtHidFName.Text = DocRoot+RelDir+EmbedFile 751ecadb57SMathias Bauer oTxtID.Text = EmbedID 761ecadb57SMathias Bauer End If 771ecadb57SMathias Bauer End If 781ecadb57SMathias Bauer 791ecadb57SMathias Bauer 801ecadb57SMathias Bauer GoForIt = 1 811ecadb57SMathias Bauer 821ecadb57SMathias Bauer If (oDialog.Execute() = 1 AND oTxtFilePath.Text <> "") Then 831ecadb57SMathias Bauer' msgbox (oTxtFilePath.Text) 841ecadb57SMathias Bauer 851ecadb57SMathias Bauer If oTxtID.Text = "" Then 861ecadb57SMathias Bauer msgbox "You did not specify a section or variable to embed.",256 871ecadb57SMathias Bauer Else 881ecadb57SMathias Bauer WriteConfig("LastEmbedAnchor",oTxtID.Text) 891ecadb57SMathias Bauer If oOpVariable.State Then 901ecadb57SMathias Bauer txtEmbed = oTxtFilePath.Text + "#" + oTxtID.Text 911ecadb57SMathias Bauer InsertTag("EMBEDVAR","<EMBEDVAR var=""" + txtEmbed + """>","hlp_aux_tag") 921ecadb57SMathias Bauer SetCharStyle("Default") 931ecadb57SMathias Bauer WriteConfig("LastEmbedType","Variable") 941ecadb57SMathias Bauer Else 951ecadb57SMathias Bauer txtEmbed = oTxtFilePath.Text + "#" + oTxtID.Text 961ecadb57SMathias Bauer CR 971ecadb57SMathias Bauer SetParaStyle("hlp_aux_embed") 981ecadb57SMathias Bauer SetCharStyle("hlp_aux_tag") 991ecadb57SMathias Bauer InsertTag("EMBED","<EMBED href=""" + txtEmbed + """>","hlp_aux_tag") 1001ecadb57SMathias Bauer CR 1011ecadb57SMathias Bauer WriteConfig("LastEmbedType","Section") 1021ecadb57SMathias Bauer End If 1031ecadb57SMathias Bauer End If 1041ecadb57SMathias Bauer End If 1051ecadb57SMathias Bauer oDialog.dispose 1061ecadb57SMathias BauerEnd Sub 1071ecadb57SMathias Bauer 1081ecadb57SMathias Bauer'======================================================= 1091ecadb57SMathias Bauer' SetLabel 1101ecadb57SMathias Bauer'------------------------------------------------------- 1111ecadb57SMathias Bauer' Changes the text field label in the dialog 1121ecadb57SMathias Bauer'======================================================= 1131ecadb57SMathias BauerSub SetLabel 1141ecadb57SMathias Bauer olblID = oDialog.GetControl("lblID") 1151ecadb57SMathias Bauer oOpVariable = oDialog.GetControl("opVariable") 1161ecadb57SMathias Bauer If oOpVariable.getState Then 1171ecadb57SMathias Bauer olblID.setText("Variable ID") 1181ecadb57SMathias Bauer oDialog.Title = "Embed Variable" 1191ecadb57SMathias Bauer Else 1201ecadb57SMathias Bauer olblID.setText("Section or Paragraph ID") 1211ecadb57SMathias Bauer oDialog.Title = "Embed Section" 1221ecadb57SMathias Bauer End If 1231ecadb57SMathias BauerEnd Sub 1241ecadb57SMathias Bauer 1251ecadb57SMathias BauerSub GetFile 1261ecadb57SMathias BauerDim ListAny(0) as Long 1271ecadb57SMathias Bauer ListAny(0) = com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE 1281ecadb57SMathias Bauer oFileDialog = CreateUnoService("com.sun.star.ui.dialogs.FilePicker") 1291ecadb57SMathias Bauer oFileDialog.Initialize(ListAny()) 1301ecadb57SMathias Bauer 1311ecadb57SMathias Bauer DocRoot = ReadConfig("HelpPrefix") 1321ecadb57SMathias Bauer sLastEmbedDir = ReadConfig("LastEmbedDir") 1331ecadb57SMathias Bauer sLastEmbedFile = ReadConfig("LastEmbedFile") 1341ecadb57SMathias Bauer 1351ecadb57SMathias Bauer If IsSubDir(sLastEmbedDir,DocRoot) Then 1361ecadb57SMathias Bauer oFileDialog.setDisplayDirectory(sLastEmbedDir) 1371ecadb57SMathias Bauer If sLastEmbedFile <> "" AND Dir(sLastEmbedDir+sLastEmbedFile) > "" Then 1381ecadb57SMathias Bauer oFileDialog.setDefaultName(sLastEmbedFile) 1391ecadb57SMathias Bauer End If 1401ecadb57SMathias Bauer Else 1411ecadb57SMathias Bauer oFileDialog.setDisplayDirectory(DocRoot) 1421ecadb57SMathias Bauer End If 1431ecadb57SMathias Bauer 1441ecadb57SMathias Bauer oMasterKey = GetRegistryKeyContent("org.openoffice.TypeDetection.Types/") 1451ecadb57SMathias Bauer oTypes() = oMasterKey.Types 1461ecadb57SMathias Bauer oFileDialog.AppendFilter("Help", "*.xhp") 1471ecadb57SMathias Bauer 1481ecadb57SMathias Bauer oFileDialog.SetTitle("Embed From Help File") 1491ecadb57SMathias Bauer iAccept = oFileDialog.Execute() 1501ecadb57SMathias Bauer If iAccept = 1 Then 1511ecadb57SMathias Bauer sPath = oFileDialog.Files(0) 1521ecadb57SMathias Bauer sCurDir = oFileDialog.getDisplayDirectory +"/" 1531ecadb57SMathias Bauer WriteConfig("LastEmbedDir",sCurDir) 1541ecadb57SMathias Bauer LastFile = Right(sPath, Len(sPath) - Len(sCurDir)) 1551ecadb57SMathias Bauer WriteConfig("LastEmbedFile",LastFile) 1561ecadb57SMathias Bauer 1571ecadb57SMathias Bauer oTxtPath = oDialog.GetControl("txtFilePath") 1581ecadb57SMathias Bauer oTxtHidFName = oDialog.GetControl("txtHidFName") 1591ecadb57SMathias Bauer oTxtHidFName.Text = sPath 1601ecadb57SMathias Bauer 1611ecadb57SMathias Bauer If IsSubDir(sCurDir,DocRoot) Then 1621ecadb57SMathias Bauer oTxtPath.Text = GetRelPath(sPath, DocRoot) 1631ecadb57SMathias Bauer Else 1641ecadb57SMathias Bauer oTxtPath.Text = sPath 1651ecadb57SMathias Bauer msgbox("File is outside of your Document Root",48,"Warning") 1661ecadb57SMathias Bauer End If 1671ecadb57SMathias Bauer 1681ecadb57SMathias Bauer oButBrowseIDs = oDialog.GetControl("butBrowseIDs") 1691ecadb57SMathias Bauer oButBrowseIDs.Enable = true 1701ecadb57SMathias Bauer End If 1711ecadb57SMathias Bauer 1721ecadb57SMathias BauerEnd Sub 1731ecadb57SMathias Bauer 1741ecadb57SMathias BauerSub UpdateFileName 1751ecadb57SMathias Bauer oTxtPath = oDialog.GetControl("txtFilePath") 1761ecadb57SMathias Bauer ShortFName = oTxtPath.Text 1771ecadb57SMathias Bauer 1781ecadb57SMathias Bauer If ShortFName > "" Then 1791ecadb57SMathias Bauer 1801ecadb57SMathias Bauer oTxtHidFName = oDialog.GetControl("txtHidFName") 1811ecadb57SMathias Bauer FName = oTxtHidFName.Text 1821ecadb57SMathias Bauer 1831ecadb57SMathias Bauer If Right(FName, Len(ShortFName)) <> ShortFName Then 1841ecadb57SMathias Bauer ' oTxtHidFName.Text = MakeAbsPath(ShortFName) 1851ecadb57SMathias Bauer oTxtHidFName.Text = ShortFName 1861ecadb57SMathias Bauer End If 1871ecadb57SMathias Bauer 1881ecadb57SMathias Bauer oButBrowseIDs = oDialog.GetControl("butBrowseIDs") 1891ecadb57SMathias Bauer If not(FileExists(oTxtHidFName.Text)) Then 1901ecadb57SMathias Bauer msgbox oTxtHidFName.Text+" cannot be found.",48,"D'oh!" 1911ecadb57SMathias Bauer oButBrowseIDs.Enable = false 1921ecadb57SMathias Bauer Else 1931ecadb57SMathias Bauer oButBrowseIDs.Enable = true 1941ecadb57SMathias Bauer End If 1951ecadb57SMathias Bauer End If 1961ecadb57SMathias BauerEnd Sub 1971ecadb57SMathias Bauer 1981ecadb57SMathias BauerSub BrowseEmbed 1991ecadb57SMathias Bauer BasicLibraries.LoadLibrary("HelpAuthoring") 2001ecadb57SMathias Bauer oBrowseDialog = LoadDialog("HelpAuthoring", "dlg_BrowseEmbed") 2011ecadb57SMathias Bauer oOpVariable = oDialog.GetControl("opVariable") 2021ecadb57SMathias Bauer oTxtPath = oDialog.GetControl("txtFilePath") 2031ecadb57SMathias Bauer oTxtHidFName = oDialog.GetControl("txtHidFName") 2041ecadb57SMathias Bauer filename = oTxtHidFName.Text 2051ecadb57SMathias Bauer 2061ecadb57SMathias Bauer ReDim arParas(0) 2071ecadb57SMathias Bauer ReDim arVars(0) 2081ecadb57SMathias Bauer ReDim arSecs(0) 2091ecadb57SMathias Bauer 2101ecadb57SMathias Bauer' msgbox(filename) 2111ecadb57SMathias Bauer 2121ecadb57SMathias Bauer iNumber = Freefile 2131ecadb57SMathias Bauer If FileExists(filename) Then 2141ecadb57SMathias Bauer Dim arLines(0) As String 2151ecadb57SMathias Bauer Open filename For Input As iNumber 2161ecadb57SMathias Bauer Do While (not eof(iNumber)) 2171ecadb57SMathias Bauer Line Input #iNumber, sLine 2181ecadb57SMathias Bauer sDim = ubound(arLines())+1 2191ecadb57SMathias Bauer ReDim Preserve arLines(sDim) 2201ecadb57SMathias Bauer arLines(sDim) = sLine 2211ecadb57SMathias Bauer Loop 2221ecadb57SMathias Bauer Close #iNumber 2231ecadb57SMathias Bauer sContent = join(arLines()," ") 2241ecadb57SMathias Bauer 2251ecadb57SMathias Bauer arTmp() = split(sContent,"<paragraph") 2261ecadb57SMathias Bauer For n=1 to ubound(arTmp()) 2271ecadb57SMathias Bauer If arTmp(n) <> "" Then 2281ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),"id=")-3) 2291ecadb57SMathias Bauer sId = Left(arTmp(n),Instr(arTmp(n),"""")-1) 2301ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),">")) 2311ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),Instr(arTmp(n),"</paragraph>")-1) 2321ecadb57SMathias Bauer If Len(arTmp(n) > 100) Then 2331ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),100)+"..." 2341ecadb57SMathias Bauer End If 2351ecadb57SMathias Bauer sDim = ubound(arParas()) 2361ecadb57SMathias Bauer arParas(sDim) = sId+": "+arTmp(n) 2371ecadb57SMathias Bauer sDim = ubound(arParas())+1 2381ecadb57SMathias Bauer ReDim Preserve arParas(sDim) 2391ecadb57SMathias Bauer End If 2401ecadb57SMathias Bauer Next n 2411ecadb57SMathias Bauer 2421ecadb57SMathias Bauer arTmp() = split(sContent,"<section") 2431ecadb57SMathias Bauer For n=1 to ubound(arTmp()) 2441ecadb57SMathias Bauer If arTmp(n) <> "" Then 2451ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),"id=")-3) 2461ecadb57SMathias Bauer sId = Left(arTmp(n),Instr(arTmp(n),"""")-1) 2471ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),">")) 2481ecadb57SMathias Bauer If Instr(arTmp(n),"</section>")>0 Then 2491ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),Instr(arTmp(n),"</section>")-1) 2501ecadb57SMathias Bauer End If 2511ecadb57SMathias Bauer If Len(arTmp(n) > 100) Then 2521ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),100)+"..." 2531ecadb57SMathias Bauer End If 2541ecadb57SMathias Bauer sDim = ubound(arSecs()) 2551ecadb57SMathias Bauer arSecs(sDim) = sId+": "+arTmp(n) 2561ecadb57SMathias Bauer sDim = ubound(arSecs())+1 2571ecadb57SMathias Bauer ReDim Preserve arSecs(sDim) 2581ecadb57SMathias Bauer End If 2591ecadb57SMathias Bauer Next n 2601ecadb57SMathias Bauer 2611ecadb57SMathias Bauer arTmp() = split(sContent,"<variable") 2621ecadb57SMathias Bauer For n=1 to ubound(arTmp()) 2631ecadb57SMathias Bauer If arTmp(n) <> "" Then 2641ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),"id=")-3) 2651ecadb57SMathias Bauer sId = Left(arTmp(n),Instr(arTmp(n),"""")-1) 2661ecadb57SMathias Bauer arTmp(n) = Right(arTmp(n),Len(arTmp(n))-Instr(arTmp(n),">")) 2671ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),Instr(arTmp(n),"</variable>")-1) 2681ecadb57SMathias Bauer If Len(arTmp(n) > 100) Then 2691ecadb57SMathias Bauer arTmp(n) = Left(arTmp(n),100)+"..." 2701ecadb57SMathias Bauer End If 2711ecadb57SMathias Bauer sDim = ubound(arVars()) 2721ecadb57SMathias Bauer arVars(sDim) = sId+": "+arTmp(n) 2731ecadb57SMathias Bauer sDim = ubound(arVars())+1 2741ecadb57SMathias Bauer ReDim Preserve arVars(sDim) 2751ecadb57SMathias Bauer End If 2761ecadb57SMathias Bauer Next n 2771ecadb57SMathias Bauer 2781ecadb57SMathias Bauer ShowSecs 2791ecadb57SMathias Bauer 2801ecadb57SMathias Bauer If oBrowseDialog.Execute() = 1 Then 2811ecadb57SMathias Bauer olbElements = oBrowseDialog.GetControl("lbElements") 2821ecadb57SMathias Bauer sSelected = olbElements.SelectedItem 2831ecadb57SMathias Bauer sSelected = Left(sSelected,Instr(sSelected,":")-1) 2841ecadb57SMathias Bauer oTxtID = oDialog.GetControl("txtID") 2851ecadb57SMathias Bauer oTxtID.Text = sSelected 2861ecadb57SMathias Bauer End If 2871ecadb57SMathias Bauer Else 2881ecadb57SMathias Bauer msgbox "Cannot open "+filename,48,"Error" 2891ecadb57SMathias Bauer End If 2901ecadb57SMathias BauerEnd Sub 2911ecadb57SMathias Bauer 2921ecadb57SMathias BauerSub UpdateLIst 2931ecadb57SMathias Bauer oOpSections = oBrowseDialog.GetControl("opSections") 2941ecadb57SMathias Bauer oOpVariables = oBrowseDialog.GetControl("opVariables") 2951ecadb57SMathias Bauer oOpParas = oBrowseDialog.GetControl("opParas") 2961ecadb57SMathias Bauer If oOpSections.getState Then 2971ecadb57SMathias Bauer ShowSecs 2981ecadb57SMathias Bauer ElseIf oOpVariables.getState Then 2991ecadb57SMathias Bauer ShowVars 3001ecadb57SMathias Bauer ElseIf oOpParas.getState Then 3011ecadb57SMathias Bauer ShowParas 3021ecadb57SMathias Bauer End If 3031ecadb57SMathias BauerEnd Sub 3041ecadb57SMathias Bauer 3051ecadb57SMathias BauerSub ShowSecs 3061ecadb57SMathias Bauer olbElements = oBrowseDialog.GetControl("lbElements") 3071ecadb57SMathias Bauer olbElements.RemoveItems(0,olbElements.ItemCount) 3081ecadb57SMathias Bauer olbElements.AddItems(arSecs(),ubound(arSecs())) 3091ecadb57SMathias Bauer oOpSection = oDialog.GetControl("opSection") 3101ecadb57SMathias Bauer oOpSection.setState(TRUE) 3111ecadb57SMathias Bauer SetLabel 3121ecadb57SMathias BauerEnd Sub 3131ecadb57SMathias Bauer 3141ecadb57SMathias BauerSub ShowVars 3151ecadb57SMathias Bauer olbElements = oBrowseDialog.GetControl("lbElements") 3161ecadb57SMathias Bauer olbElements.RemoveItems(0,olbElements.ItemCount) 3171ecadb57SMathias Bauer olbElements.AddItems(arVars(),ubound(arVars())) 3181ecadb57SMathias Bauer oOpVariable = oDialog.GetControl("opVariable") 3191ecadb57SMathias Bauer oOpVariable.setState(TRUE) 3201ecadb57SMathias Bauer SetLabel 3211ecadb57SMathias BauerEnd Sub 3221ecadb57SMathias Bauer 3231ecadb57SMathias BauerSub ShowParas 3241ecadb57SMathias Bauer olbElements = oBrowseDialog.GetControl("lbElements") 3251ecadb57SMathias Bauer olbElements.RemoveItems(0,olbElements.ItemCount) 3261ecadb57SMathias Bauer olbElements.AddItems(arParas(),ubound(arParas())) 3271ecadb57SMathias Bauer oOpVariable = oDialog.GetControl("opSection") 3281ecadb57SMathias Bauer oOpVariable.setState(TRUE) 3291ecadb57SMathias Bauer SetLabel 3301ecadb57SMathias BauerEnd Sub 3311ecadb57SMathias Bauer 3321ecadb57SMathias BauerSub CheckButton 3331ecadb57SMathias Bauer olbElements = oBrowseDialog.GetControl("lbElements") 3341ecadb57SMathias Bauer obutSelect = oBrowseDialog.GetControl("butSelect") 3351ecadb57SMathias Bauer sSelected = olbElements.SelectedItem 3361ecadb57SMathias Bauer If sSelected = "" Then 3371ecadb57SMathias Bauer oButSelect.enable = false 3381ecadb57SMathias Bauer Else 3391ecadb57SMathias Bauer oButSelect.enable = true 3401ecadb57SMathias Bauer End If 3411ecadb57SMathias BauerEnd Sub 3421ecadb57SMathias Bauer 3431ecadb57SMathias Bauer 3441ecadb57SMathias BauerFunction IsSubDir(D as String, R as String) 3451ecadb57SMathias Bauer IsSubDir = (Left(D,Len(R)) = R) 3461ecadb57SMathias BauerEnd Function 347*3e02b54dSAndrew Rist</script:module> 348