function word_report ( Titel, pic_files )


% Start MS Word
% function startServ1
wd1 = actxserver ( 'Word.Application' );
set ( wd1, 'Visible', 1 );

% startServ1;

% create a document
%file_word = wd1.Documents.Add;
wd1_handle = wd1.Documents.Add;

% go to the end of the file
wdStory = 6;
wd1.Selection.EndKey ( wdStory );
% wd1_handle = invoke(wd1.Documents,'Open',file_word);

% add text
wd1.Selection.Font.Name = 'Arial';
wd1.Selection.Font.Size = 16;
wd1.Selection.Font.Bold = true;
Titel = char(Titel);
wd1.Selection.TypeText ( Titel );
wd1.Selection.TypeParagraph; wd1.Selection.TypeParagraph; wd1.Selection.TypeParagraph;
wd1.Selection.Font.Size = 12;
wd1.Selection.Font.Bold = false;

% add plot to word
for k = 1 : length ( pic_files (:,1) )
    pic = char(pic_files(k,1));
    wd1.Selection.InlineShapes.AddPicture ( pic );
    wd1.Selection.MoveRight (1);
    
    numShapes = wd1_handle.InlineShapes.Count;
    wd1_handle.Selection.InlineShapes.Item(numShapes).LockAspectRatio = 'msoTrue';
    wd1_handle.InlineShapes.Item(numShapes).Height=540;
    %wd1_handle.InlineShapes.Width=720;
    %wd1.Selection.InlineShapes.LockAspectRatio = char('msoTrue');
    %wd1.Selection.InlineShapes.Width = 396;
    
    wd1.Selection.TypeParagraph; wd1.Selection.TypeParagraph; wd1.Selection.TypeParagraph;
end




wd1.Quit;

