title image


Smiley Module über VBA exportieren
Das geht z.B. so:



Public Function ExportAllModules()

Dim Mdl As Module, Frm As Form, Rpt As Report, _

Doc As DAO.Document, DB As DAO.Database, OChan As Integer

OChan = FreeFile

Open "C:\Temp\AllMyModules.TXT" For Output As #OChan

Set DB = CurrentDb

For Each Doc In DB.Containers!Modules.Documents

DoCmd.OpenModule Doc.Name

Set Mdl = Modules(Doc.Name)

Print #OChan, "'-=+=- Module: " & Doc.Name & " -=+=------------------- "

Print #OChan, Mdl.Lines(1, Mdl.CountOfLines)

Print #OChan, "'-=+=- End of Module: " & Doc.Name & " -=+=------------------- "

Print #OChan, ""

Print #OChan, ""

DoCmd.Close acModule, Doc.Name, acSaveNo

Next Doc



For Each Doc In DB.Containers!Forms.Documents

DoCmd.OpenForm Doc.Name, acDesign, , , , acHidden

Set Frm = Forms(Doc.Name)

Set Mdl = Frm.Module

Print #OChan, "'-=+=- Form: " & Doc.Name & " -=+=------------------- "

If Mdl.CountOfLines > 0 Then Print #OChan, Mdl.Lines(1, Mdl.CountOfLines)

Print #OChan, "'-=+=- End of Form: " & Doc.Name & " -=+=------------------- "

Print #OChan, ""

Print #OChan, ""

DoCmd.Close acForm, Doc.Name, acSaveNo

Next Doc



For Each Doc In DB.Containers!Reports.Documents

DoCmd.OpenReport Doc.Name, acViewDesign

Set Rpt = Reports(Doc.Name)

Set Mdl = Rpt.Module

Print #OChan, "'-=+=- Report: " & Doc.Name & " -=+=------------------- "

Print #OChan, Mdl.Lines(1, Mdl.CountOfLines)

Print #OChan, "'-=+=- End of Report: " & Doc.Name & " -=+=------------------- "

Print #OChan, ""

Print #OChan, ""

DoCmd.Close acReport, Doc.Name, acSaveNo

Next Doc

Close OChan

End Function



Gruß aus dem Norden
Reinhard


Bitte immer die Access-Version angeben!
DB-Wiki


Wie man Fragen richtig stellt

YaccessAccess-FAQUnd ansonsten: Wikipedia




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: