mercredi 31 mai 2017

How to use Word Com Application in Laravel Controller?

I'm use Laravel 5.4, PHP 7.1 on XAMPP. In advance I will say that the PHPWord does not suit me. I Want use Com Application in Laravel controller:

namespace App\Http\Controllers;
use App\Library\NCLNameCaseRu;
use DB;

class TestController extends Controller {

    public function index() {


        $debtid = DB::select(
            "EXECUTE dbo.SP_JudgApplicationFl @DebtID = ?", array('38')
        );



        foreach ($debtid as $v) {
            print_r($v->AccountNumber);
            $word = new \COM("Word.Application", null, CP_UTF8);
            $word->Visible = 0;
            $word->Documents->Add("C:/xampp/htdocs/myfile.dotx");
        }

    }

}

But i get error

Class 'COM' not found

I successfully connected a class "NCLNameCaseRu" with composer autoload. But this i have specific folder with class. How can I do the same with COM application?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qA9N5Z
via IFTTT

Aucun commentaire:

Enregistrer un commentaire