Newsgroup: it.comp.appl.access
Titolo: Stampare contenuto cartella solo se esiste.

Ciao a tutti sono Dino.
Con questa funzione (trovata ovviamente sul sito di Alex) riesco ha
stampare il contenuto di ogni cartella.Private Sub Comando924_Click()
   Dim sMsg As String
   Dim fi As FOLDER_INFO
   fi = GetFolderInfo(Me.Percorso)
   Dim x As Integer
   If IsArray(sFiles) Then
      For x = 0 To UBound(sFiles())
         Call PrintBatch(sFiles(x), "", SW_HIDE, False, True)
      Next
   End If
  sMsg = "Folder: " & Me.Percorso & vbCrLf
  sMsg = sMsg & vbCrLf & "Total " & fi.DirSize & " bytes" & " in " &
fi.FilesCount & " files at " & fi.DirsCount & " Folders "
  MsgBox sMsg
Ovviamente come vedete la cartella dastampare e' associata ad un campo
che varia (Me.Percorso).
Se la cartella c'e' tutto Ok se invece la cartella non esiste questa
funzione mi va ha stampare il contenuto della cartella documenti.
Se e' possibile io vorrei invece in caso di mancanza dati non far
stampare niente o far comparire un avviso.
Grazie in anticipo
Saluti Dino

 ha scritto nel messaggio 
news:ad1de889-dafe-4821...@21g2000hsj.googlegroups.com...

Metti un if Dir(Me.Percorso, vbDirectory) = "" then msgbox "cartella vuota"
Ciao
-- 
Roberto da Parma

 Saluti Dino
-- 
Ciao
Geppo 

 - Mostra testo tra virgolette -
Ciao Roby sono Dino.
Grazie per il consiglio.Ho provato ad inserire il ciclo If ma durante
il debug mi da questo errore:
Errore di run time 94 :Utilizzo non valido di Null.Di seguito ti
rporto la funzione con il tuo ciclo If:
Private Sub Comando924_Click()
   Dim sMsg As String
   Dim fi As FOLDER_INFO
   fi = GetFolderInfo(Me.Percorso)
   Dim x As Integer
   If Dir(Me.Percorso, vbDirectory) = "" Then
   MsgBox "cartella vuota"
    If IsArray(sFiles) Then
      For x = 0 To UBound(sFiles())
         Call PrintBatch(sFiles(x), "", SW_HIDE, False, True)
      Next
   End If
  sMsg = "Folder: " & Me.Percorso & vbCrLf
  sMsg = sMsg & vbCrLf & "Total " & fi.DirSize & " bytes" & " in " &
fi.FilesCount & " files at " & fi.DirsCount & " Folders "
  MsgBox sMsg
  End If
End Sub
Se puoi aspetto tur notizie
Grazie ancora

 - Mostra testo tra virgolette -
Grazie Geppo per il consiglio.inserendo il tuo ciclo If mi da pero'
errore dicendo:
Si e' verificato un errore "NOME DEL COMANDO 924 CLICK()  NON UNIVOCO"
Se puoi aspetto una risposta.
Saluti Dino

 - Mostra testo tra virgolette -
Geppo e Roby  sono sempre Dino Ho risolto in questo Modo:
Private Sub Comando924_Click()
  If Me.Percorso > 0 Then
   Dim sMsg As String
   Dim fi As FOLDER_INFO
   fi = GetFolderInfo(Me.Percorso)
   Dim x As Integer
   If IsArray(sFiles) Then
      For x = 0 To UBound(sFiles())
         Call PrintBatch(sFiles(x), "", SW_HIDE, False, True)
      Next
   End If
  sMsg = "Folder: " & Me.Percorso & vbCrLf
  sMsg = sMsg & vbCrLf & "Total " & fi.DirSize & " bytes" & " in " &
fi.FilesCount & " files at " & fi.DirsCount & " Folders "
  MsgBox sMsg
  Else
  MsgBox "Attenzione!!! Cartella vuota!Stampa annullata"
  End If
End Sub
Grazie ancora
Saluti Dino

 ha scritto nel messaggio 
news:b9e6089c-0670-4acd...@d4g2000prg.googlegroups.com...


Non so quanto corretto sia scrivere Me.percorso > 0, ma se ti funziona....
Il controllo comunque lo dovresti fare sul contenuto non sulla lunghezza 
della stringa...
Tutt'al più scriverei Len(Me.percorso) poi dipende da come naturalmente hai 
strutturato il tuo codice.


workers in all the open ports of China. Chinese men are
constantly returning to China to "marry," in duly prescribed form, and
then return with their wives and reënter the United States, merely to
put the women into the brothels. Any man who is willing to run the
risk of detection can thus get a trip home to China to see his lawful
wife and family, and make it a profitable business trip besides,--with
all expenses more than paid by the importation, and sale of a slave.
Chinese women are constantly returning to China to bring "daughters"
to put in the slave pens. No woman (even lawfully married to a
Chinaman), should be allowed to take a ticket at Hong Kong or any of
the open ports of China for the United States, whose case has not been
thoroughly investigated by days of acquaintance with a woman inspector
in a house of detention, if necessary, on the other side. And no
Chinese woman should be allowed to enter on this side of the water,
until she has passed the second time under such surveillance in a
house of detention. And such rescue workers should have the Government
authority signified by a policeman's star.
The evil to be combated should be met with the right remedy. "Fitches
are not threshed with a thresher, neither is a cart wheel turned about
upon the cummin; but the fitches are beaten out with a staff, and the
cummin with a rod." Much of the failure to control brothel slavery
has grown out of the application of the wrong remedy, not out of a
difficulty in controlling the Chinese. These cases of trading in human
flesh have generally been treated in the courts as though coming under
the laws against ordinary prostitution. To illustrate:
Within the past month, three Chinese girls were captured by a rescue
worker. They were cooped up, with a man who had charge of them, in
a tiny closet scarcely sufficient to hold the four, which had been
entered by a panel door which was securely nailed up and bag

sure of the capture, found the dollar given by King
to his cook "lying on the bed" in the room occupied by the women,
and they were convicted on no other evidence than this and Lee's
"suspicions."
Private Michael Smith of the 80th Regiment was given four dollars by
Inspector Morton and instructed to go to a certain Mrs. Wright at
her quarters, and try to debauch her; he drank brandy with her [at
Government expense?] from 10 p.m. until 5 a.m., but failed in his
errand. Why did she not turn him out of the house? Women were
frequently fined for daring to resent the aggressions of these
informers. In one case a man was struck for trying to obstruct the
arrest of a girl of 14, and later was punished. This girl was proved
to be a virgin afterwards. Many women and girls, against whom there
was no sufficient evidence, were sent to the Lock Hospital for
examination in order to determine in that manner their character. In
half-a-dozen cases or so, it is recorded that the result determined
the virginity of the person. But such a test as this rests upon the
accidental presence of an exceptional condition among even virgins,
and what became of those who did not answer to the exceptional test,
and yet were as pure as the rest? They would everyone of them be
consigned to the fate of a brothel slave.
One informer, "with the assistance of public money, and in the
interests of justice," according to the Commission's report, sinned
with a child of fifteen in order to get her name on the register.
Inspector Horton bargained for the deflowering of a virgin of 15, "in
the interests of justice," with the owner of the slave child. The
child as well as the owner were then taken to the Lock Hospital, where
the latter was proved to be a virgin. A Chinese informer consorted
with a girl named Tai-Yau "against her will, which led to his being
rewarded, and to her being fined one hundred dollars." She was una

up from babyhood in familiarity with vice, that to consult the option
of such an one in determining the existence or non-existence of
_slavery_ in America, is a thing that ought not to be tolerated for a
moment.
We have shown how every Chinese girl who has escaped from her
servitude to the city of refuge,--the mission home,--is received and
welcomed. How the rescued and rescuer run the race for dear life, and
the pursuers are obliged to turn back at the door. But what a state
of things in this country which we call free! Should not the entire
country be one great city of refuge? Do we not pretend that it is such
to all who are oppressed? Why should not the pursuer be turned back at
the Golden Gate, rather than at the door of an exceptional home in
San Francisco? We are fond of saying that under the stars and stripes
slavery cannot exist. We must make it good, or acknowledge, in dust
and ashes of repentance, that we are hypocrites. Idle words will not
do in place of deeds; we must make good our profession at any cost.
Everyone of these Chinese women should be removed from the brothels,
whereve

more hopeful of amendment,
and we will be content to leave the issue with God.
It was our purpose when we undertook the task of writing a sketch
which would enable Americans to understand the social conditions that
are being introduced into our midst from the Orient, merely to make
a concise, brief statement of social conditions in Hong Kong out of
which these have grown, drawing our information from State Documents
of the British Government that we have had for some time in our
possession, and of which we have made a close study, as well as from
our own observations of the conditions themselves as they exist at
Hong Kong and Singapore. But almost at once we abandoned that attempt
as unwise because likely to prove injurious rather than helpful to the
object we have in view. The facts that we have to relate form one of
the blackest chapters in the history of human slavery, and slavery
brought up to the present time. Our statements if standing merely on
our own word would be met at once with incredulity and challenged, and
before we could defend them by producing the proof, a prejudice would
be created that might prove disastrous to our hopes of arousing our
country to the point