Word Problem (Sichtbarkeit)



  • Also auf Empfehlung soll ich hier den Thread machen 😃

    Verwende C++ Builder 6, will durch drücken eines Buttons das sich Word öffnet...

    der Code ist der folgenden:

    void __fastcall TForm1::Button2Click(TObject *Sender)
    {
    WordApplication1->Connect();
    WordApplication1->Visible=true;
    WordApplication1->Documents->Add();            //neues Word-Dokument wird erzeugt
    
    WordApplication1->Selection->Font->Bold=true;
    WordApplication1->Selection->Font->Size=15;
    WordApplication1->Selection->TypeText(StringToOleStr("Fette überschrift"));      //dieser Text wird gedruckt
    WordApplication1->Selection->TypeParagraph();        //Zeilenvorschub
    WordApplication1->Selection->TypeParagraph();
    
    WordApplication1->Selection->Font->Bold=false;
    WordApplication1->Selection->Font->Size=10;
    WordApplication1->Selection->TypeText(StringToOleStr("nicht Fette überschrift"));
    WordApplication1->Selection->TypeParagraph();
    WordApplication1->Selection->TypeParagraph();
    
    WordApplication1->ChangeFileOpenDirectory(StringToOleStr("D:\\versuch")); //wird file geschlossen X, dann dorthin gespeichert
    WordApplication1->ActiveDocument->SaveAs(OleVariant(StringToOleStr("versuch1.doc")));
    //WordApplication1->PrintOut();       //druckt aus
    }
    

    Bei dieser Zeile =>

    WordApplication1->Visible=true;

    wird mir der Fehler ==>

    visible is not accessible

    angezeigt....

    wenn ich diese Zeile wektue, dann funtzt alles, word öffnet sich, nur sieht man es nicht ... logisch +gg+

    nun in der hilfe steht genau dieser Befehl drinnen ??

    ich kann mich erinnern das dieser code letztes jahr aber gegangen ist!

    kann es vll daran liegen das ich Word 07 und XP SP3 verwende?

    Bitte um Hife : D




Anmelden zum Antworten