View Single Post
 
Old 09-21-2017, 07:52 PM
sas sas is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Sep 2017
Posts: 3
sas is on a distinguished road
Default

Thanks Macropod!

I updated my code as following, but this does not work.

I hightlighted the part I updated per your comments. Is this correct?


filename script "C:\Users\zzz\Desktop\New\wdtb2ppt.vbs";

data _null_;
file script;
put 'Set objWord = CreateObject("Word.Application")';
put 'objWord.Visible = False';
/* Slide 1*/
put 'Set objDoc = objWord.Documents.Open("' "C:\Users\zzz\Desktop\New\t_aesum_age_saf.rtf"'")' ;
put 'Set objSelection = objWord.Selection';
put 'Set objPPT = CreateObject("PowerPoint.Application")';
put 'objPPT.Visible = True';
put 'Set objPresentation = objPPT.Presentations.Add';
/* put 'objPresentation.ApplyTemplate("C:\temp\tmp3.pot") ';*/

put 'Sub Demo2()';
put 'Dim Tbl As Table';
put 'For Each Tbl In ActiveDocument.Tables';
put 'objDoc.Activate';
put 'With Tbl';
put 'objDoc.Tbl.Range.Select';
put 'End With';
put 'Tbl.Range.Copy';
put 'Set objSlide = objPresentation.Slides.Add(1,12)';
put 'objPPT.ActiveWindow.View.Paste';
put 'Next';
put 'End Sub';



put 'objPresentation.SaveAs("C:\Users\zzz\Desktop\New\ table.ppt")';
put 'objPresentation.Close';
put 'objPPT.Quit';
put 'objDoc.Close';
put 'objWord.Quit';
run;

filename xx pipe "cscript //nologo ""C:\Users\zzz\Desktop\New\wdtb2ppt.vbs""";
data _null_;
infile xx;
input;
put _infile_;
run;
Reply With Quote