MichaelRed
Programmer
I have read / seen numerous rererences to ths (hidden) method and it's compliment. I have tried a couple of the more straight forward implementations. Alas Alack and Awry no joy in mudville. The specifc Procedure:
Returns an error "cannot open " & *** & file where the file name is the name of hte first object (always a FORM) in the numerous variations of the path. Some seem to have success with this, whilst others complain. Does anybody have any insight as to WHY the file name cannot be opened / created / accessed? I'm running Ms. A. ver 2k3 on XP Home from this location, if any of that matters.
MichaelRed
Code:
Public Function SaveAllAsText(sPath)
Dim vObject As Object
Dim Idx As Integer
Dim dbs As DAO.Database
Set dbs = CurrentDb
For Each vObject In dbs.Containers("Forms").Documents
Application.SaveAsText acForm, vObject.name, sPath & "\" & vObject.name & ".xcf."
Next
For Each vObject In dbs.Containers("Reports").Documents
Application.SaveAsText acReport, vObject.name, sPath & "\" & vObject.name & ".xcr"
Next
For Each vObject In dbs.Containers("Modules").Documents
Application.SaveAsText acModule, vObject.name, sPath & "\" & vObject.name & ".xcm"
Next
For Each vObject In dbs.Containers("Scripts").Documents
Application.SaveAsText acMacro, vObject.name, sPath & "\" & vObject.name & ".xcs"
Next
For Idx = 0 To dbs.QueryDefs.Count - 1
If Left(dbs.QueryDefs(Idx).name, 4) <> "~sq_" Then
Application.SaveAsText acQuery, dbs.QueryDefs(Idx).name, _
sPath & "\" & dbs.QueryDefs(Idx).name & ".xcq"
End If
Next Idx
Debug.Print "All done"
End Function
Returns an error "cannot open " & *** & file where the file name is the name of hte first object (always a FORM) in the numerous variations of the path. Some seem to have success with this, whilst others complain. Does anybody have any insight as to WHY the file name cannot be opened / created / accessed? I'm running Ms. A. ver 2k3 on XP Home from this location, if any of that matters.
MichaelRed