Replace:
$ret=com_propset($word,Selection.Font.bold,True);
     $word->Selection->Font->bold("$ret");
With:
     $word->Selection->Font->bold=true; #Set font to bold for rest of
document
Or, to set all document to font/bold:
        $word->Documents->Add();
      $myRange = $word->ActiveDocument->Content;
      $myRange->Font->bold=true;

A+
Alain

-----Original Message-----
From: stéphane BOUCHONNET [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 5:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] COM adn PHP4


Hello,

I'm a frenchman, and i try to use COM functions in
WORD with no sucess.

here is a part of my code where i try to simply put a
bold font at true in
order to make a beautiful document, but i can't.


Perhaps do you know a good site or document on this
,or
giving me teh good syntax.

best regards.

My configuration : windows 98
PHP4.0.6.
Apache 1.3.22
Mysql


script :
    $word = new COM("word.application") or die
           ("Impossibilité d'instancier Word");

     # Rendre visible la fenêtre Word
     $word->Visible = 1;

     # Ouvrir un nouveau document
     $word->Documents->Add();

     $word->Selection->TypeText("Document en cours de
développement....");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeParagraph();
     $ret=com_propset($word,Selection.Font.bold,True);
     $word->Selection->Font->bold("$ret");
     $word->Selection->TypeText("$coll[1] $coll[0]");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeParagraph();

     $word->Selection->TypeText("né le : $naissance");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeText("Fonction    :
$fonc[0]");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeText("Nationalité :
$nat[0]");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeText("CLIENTS");
     $word->Selection->TypeParagraph();
     $word->Selection->TypeText("$coll[12]");


     # Sauvegarder le document
     $word->Documents[1]->SaveAs("CV $coll[1]
$coll[0]");
     //Libération des ressources
     $word = null;
     unset($word);

=====
@+Stéphane

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to