1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| nombre_shapes est un entier=word>>activedocument>>shapes>>count()
POUR boucle_shapes=1 _À_ nombre_shapes => dans les champs texte
nombre_fields_shapes est un entier=word>>activedocument>>shapes(boucle_shapes)>>textframe>>textrange>>fields>>count()
POUR boucle_fields_shapes=1 _À_ nombre_fields_shapes
nom_field_shapes est une chaîne=SansEspace(Remplace(word>>activedocument>>shapes(boucle_shapes)>>textframe>>textrange>>fields(boucle_fields_shapes)>>code>>text,"MERGEFIELD",""))
sql_requete_recherchezone_fusion_total="select * from zone_fusion_total where "+recherche_preparation("nom_zone_fusion",ExtraitChaîne(nom_field_shapes,1," "),"","")
HExécuteRequêteSQL(sql_source_recherche_zone_fusion_total,la_connexion,hRequêteSansCorrection,sql_requete_recherchezone_fusion_total)
HLitPremier(sql_source_recherche_zone_fusion_total)
SI ChaîneFormate(ExtraitChaîne(nom_field_shapes,1," "),ccMinuscule)=ChaîneFormate(sql_source_recherche_zone_fusion_total.nom_zone_fusion,ccMinuscule) ALORS => on vérifie que le champ est accepté
SI analyse_table_champ(nom_field_shapes)=Faux ALORS TableAjouteLigne(table_zone_pdf,nom_field_shapes,"") => on vérifie que le champ n'est pas encore présent
FIN
FIN
FIN
nombre_section est un entier=word>>activedocument>>sections(1)>>footers(1)>>range>>fields>>count()
POUR boucle_section_fields=1 _À_ nombre_section => dans l'entête/pied de page
nom_field_sections est une chaîne=SansEspace(Remplace(word>>activedocument>>sections(1)>>footers(1)>>range>>fields(boucle_section_fields)>>code>>text,"MERGEFIELD",""))
sql_requete_recherchezone_fusion_total="select * from zone_fusion_total where "+recherche_preparation("nom_zone_fusion",ExtraitChaîne(nom_field_sections,1," "),"","")
HExécuteRequêteSQL(sql_source_recherche_zone_fusion_total,la_connexion,hRequêteSansCorrection,sql_requete_recherchezone_fusion_total)
HLitPremier(sql_source_recherche_zone_fusion_total)
SI ChaîneFormate(ExtraitChaîne(nom_field_sections,1," "),ccMinuscule)=ChaîneFormate(sql_source_recherche_zone_fusion_total.nom_zone_fusion,ccMinuscule) ALORS
SI analyse_table_champ(nom_field_sections)=Faux ALORS TableAjouteLigne(table_zone_pdf,nom_field_sections,"")
FIN
FIN
nombre_fields est un entier=word>>activedocument>>mailmerge>>fields>>count()
POUR boucle_field=1 _À_ nombre_fields => dans le reste du document
nom_field est une chaîne=SansEspace(Remplace(word>>activedocument>>mailmerge>>fields(boucle_field)>>code>>text,"MERGEFIELD",""))
SI recherche_parametres_generaux("dossier_fusion_trace","N","","FUSION")="O" ALORS Trace(word>>activedocument>>mailmerge>>fields(boucle_field)>>code>>text)
nom_field=Remplace(nom_field,"""","")
nom_field=SansEspace(Remplace(nom_field,"\* MERGEFORMAT",""))
nom_field=SansEspace(ExtraitChaîne(nom_field,1," "))
sql_requete_recherchezone_fusion_total="select * from zone_fusion_total where "+recherche_preparation("nom_zone_fusion",ExtraitChaîne(nom_field,1," "),"","")
HExécuteRequêteSQL(sql_source_recherche_zone_fusion_total,la_connexion,hRequêteSansCorrection,sql_requete_recherchezone_fusion_total)
HLitPremier(sql_source_recherche_zone_fusion_total)
SI ChaîneFormate(ExtraitChaîne(nom_field,1," "),ccMinuscule)=ChaîneFormate(sql_source_recherche_zone_fusion_total.nom_zone_fusion,ccMinuscule) ALORS
SI analyse_table_champ(nom_field)=Faux ALORS TableAjouteLigne(table_zone_pdf,nom_field,"")
FIN
FIN |
Partager