|
| 1 | +const AddInName = "ACLib-FilterForm-Wizard" |
| 2 | +const AddInFileName = "ACLibFilterFormWizard.mda" |
| 3 | +const MsgBoxTitle = "Update ACLib-FilterForm-Wizard" |
| 4 | + |
| 5 | +MsgBox "Vor dem Aktualisieren der Add-In-Datei darf das Add-In nicht geladen sein!" & chr(13) & _ |
| 6 | + "Zur Sicherheit alle Access-Instanzen schließen.", , MsgBoxTitle & ": Hinweis" |
| 7 | + |
| 8 | +Select Case MsgBox("Soll das Add-In als MDE verwendet werden?" + chr(13) & _ |
| 9 | + "(Add-In wird kompiliert ins Add-In-Verzeichnis kopiert.)", 3, MsgBoxTitle) |
| 10 | + case 6 ' vbYes |
| 11 | + CreateMde GetSourceFileFullName, GetDestFileFullName |
| 12 | + MsgBox "Add-In wurde kompilliert und in '" + GetAddInLocation + "' abgespeichert", , MsgBoxTitle |
| 13 | + case 7 ' vbNo |
| 14 | + FileCopy GetSourceFileFullName, GetDestFileFullName |
| 15 | + MsgBox "Add-In wurde in '" + GetAddInLocation + "' abgespeichert", , MsgBoxTitle |
| 16 | + case else |
| 17 | + |
| 18 | +End Select |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +'################################################## |
| 25 | +' Hilfsfunktionen: |
| 26 | + |
| 27 | +Function GetSourceFileFullName() |
| 28 | + GetSourceFileFullName = GetScriptLocation & AddInFileName |
| 29 | +End Function |
| 30 | + |
| 31 | +Function GetDestFileFullName() |
| 32 | + GetDestFileFullName = GetAddInLocation & AddInFileName |
| 33 | +End Function |
| 34 | + |
| 35 | +Function GetScriptLocation() |
| 36 | + |
| 37 | + With WScript |
| 38 | + GetScriptLocation = Replace(.ScriptFullName & ":", .ScriptName & ":", "") |
| 39 | + End With |
| 40 | + |
| 41 | +End Function |
| 42 | + |
| 43 | +Function GetAddInLocation() |
| 44 | + |
| 45 | + GetAddInLocation = GetAppDataLocation & "Microsoft\AddIns\" |
| 46 | + |
| 47 | +End Function |
| 48 | + |
| 49 | +Function GetAppDataLocation() |
| 50 | + |
| 51 | + Set wsShell = CreateObject("WScript.Shell") |
| 52 | + GetAppDataLocation = wsShell.ExpandEnvironmentStrings("%APPDATA%") & "\" |
| 53 | + |
| 54 | +End Function |
| 55 | + |
| 56 | +Function FileCopy(SourceFilePath, DestFilePath) |
| 57 | + |
| 58 | + set fso = CreateObject("Scripting.FileSystemObject") |
| 59 | + fso.CopyFile SourceFilePath, DestFilePath |
| 60 | + |
| 61 | +End Function |
| 62 | + |
| 63 | +Function CreateMde(SourceFilePath, DestFilePath) |
| 64 | + |
| 65 | + Set AccessApp = CreateObject("Access.Application") |
| 66 | + AccessApp.SysCmd 603, (SourceFilePath), (DestFilePath) |
| 67 | + |
| 68 | +End Function |
0 commit comments