Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1149 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  vbs html word textbox

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

vbs html word textbox

n°1155761
jnauche
Posté le 21-07-2005 à 11:41:24  profilanswer
 


Bonjour a tous, j'ai une question assez technique concernant le remplacement de texte dans word dans une textbox (textbox est une option de la toolbar "dessin" on peut ecrire dedans et ensuite la deplacer ou on veut dans notre page word.
 
Je remplace deja du text dans word mais j'arrive pas a remplacer dans la textbox par contre?...
 
 
Set doc = objWord.Documents.Add(path_doc & "\" & tab_a_generer(j) & ".doc" )
   For i=0 to UBound(tableau)
   Execute "tempo=" & tableau(i,2)
   With objWord.Selection.Find
    .ClearFormatting()
           .Text = "@" & tableau(i,0) & "@"
           With .Replacement
            .ClearFormatting()
            .Text = tempo
           End With
    .Execute , , , , , , , , , , wdReplaceAll  
 End With
End if
 
Ceci remplace du text dans ma page word, ca marche tres bien
 
 
 
 
For Each objShape In objWord.ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes
   For i=0 to UBound(tableau)
    Execute "tempo=" & tableau(i,2)
    tempo = modiftextdoc(tempo)
    Select Case objShape.Type  
     Next
    Case msoTextBox  
     With objShape.TextFrame.TextRange  
      .Text = Replace(.Text,"@" & tableau(i,0) & "@", tempo)  
     End With  
    End Select
   Next
  Next
 
Ceci remplace du texte dans les textbox qui appartiennent a un pied ou entete de page et ca amrche aussi!!!
 
 
Mais j'arrive pas a trouver pour les textbox qui sont dans la page meme, j'ai tenter ceci mais ca marche pas
 
For Each objShape In objWord.ActiveDocument.Shapes
   For i=0 to UBound(tableau)
    Execute "tempo=" & tableau(i,2)
    tempo = modiftextdoc(tempo)
    Select Case objShape.Type  
    Case msoTextBox  
     With objShape.TextFrame.TextRange  
      .Text = Replace(.Text,"@" & tableau(i,0) & "@", tempo)  
     End With  
    End Select
   Next
  Next
 
Voila, si kelkun a une idé eou une question je suis preneur

mood
Publicité
Posté le 21-07-2005 à 11:41:24  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  vbs html word textbox

 

Sujets relatifs
[HTML]Afficher le chemin completHTML -> probleme de mise en forme
Afficher une image locale dans un fomulaire HTMLvbs et html question (a priori)
Trier un "tableau" (d'une page html) issue d'un resultset java ?[HTML/CSS] - Problème d'affichage margin-top: -10px; sous IE [RESOLU]
[Résolu] contenu de textboxhtml php et mysql
Afficher une page html dans un programme[HTML] Comment avoir un paragraphe justifié, avec une largeur donnée?
Plus de sujets relatifs à : vbs html word textbox


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR