Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2017, 06:55 PM
sas sas is offline New learner need help - convert tables in word format to ppt slides. Windows 10 New learner need help - convert tables in word format to ppt slides. Office 2010 64bit
Novice
New learner need help - convert tables in word format to ppt slides.
 
Join Date: Sep 2017
Posts: 3
sas is on a distinguished road
Default New learner need help - convert tables in word format to ppt slides.

Hello all.



I am new learner in VBA, and writing some VBscript in SAS.

I want to convert tables in word format (.rtf) to ppt slides (.ppt). The following is my code, which could copy the first table in the specific word file, paste into a new ppt file and save under certain folder. I need help on these two questions.

1. How to get the number of tables in the word file?
2. Once I got the number of tables, how to write a loop and copy/paste each table into the ppt file? Each table will be on one slide of ppt file.

Thank you very much!



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 'objDoc.Activate';
put 'objDoc.Tables(1).Range.Select';
put 'objSelection.Copy';
put 'Set objSlide = objPresentation.Slides.Add(1,12)';
put 'objPPT.ActiveWindow.View.Paste';

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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
New learner need help - convert tables in word format to ppt slides. Convert Word Tables to PDF tcoggins Word Tables 2 06-29-2016 10:28 AM
New learner need help - convert tables in word format to ppt slides. Excel Tables in Word, format issues kamal.shah Word Tables 2 01-26-2015 03:47 AM
convert tables to fillable forms in word expert4knowledge Word 1 02-13-2014 03:06 AM
New learner need help - convert tables in word format to ppt slides. Unable to convert word to MOBI format fig000 Word 1 11-17-2013 01:46 AM
Convert a file from HTML to WORD format weblayout view gtselvam Word 0 12-02-2008 03:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft