0 Then For Each Foto In Articolo.Photos If Foto.IdType=IdTipoFoto Then NomeFoto=Foto.FullFilePath If NomeFoto"" Then Conta=Conta+1 If Conta>=NumFoto Then Exit For Else NomeFoto="" End If End If End If Next End If Set Articolo=Nothing If NomeFoto"" Then Exit For End If Next Response.Write(NomeFoto)[/codevb]" name="description" />
 

Recupero dei percorsi foto per gli articoli contenuti in un documento (stampa immagini)

Creato il: 05.05.2021
Sfruttando la funzionalita' "Stampa speciale / Stampa come immagine" e' possibile stampare le foto degli articoli contenuti in un documento, utilizzando uno script che recuperi il percorso di ogni foto.

N.B. Lo script va replicato per ogni eventuale foto da stampare.

Option Explicit
 
Dim Riga
Dim Articolo
Dim IdTipoFoto
Dim Foto
Dim NomeFoto
Dim NumFoto
Dim Conta
IdTipoFoto=1 ' Tipo foto da stampare
NumFoto=3 ' il numero della foto da esportare (1a foto, 2a foto, ecc.)

'======================================================

Conta=0
 
For Each Riga In Doc.DocRows
   Set Articolo=Riga.Product
   If Articolo.Id>0 Then
       For Each Foto In Articolo.Photos
           If Foto.IdType=IdTipoFoto Then
               NomeFoto=Foto.FullFilePath
               If NomeFoto<>"" Then
                   Conta=Conta+1
                   If Conta>=NumFoto Then
                       Exit For
                   Else
                       NomeFoto=""
                   End If
               End If
            End If
       Next
   End If
   Set Articolo=Nothing
   If NomeFoto<>"" Then
       Exit For
   End If
Next
 
Response.Write(NomeFoto)

Login