| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 73004 | 2006-10-04 03:34:00 | importing a database to make a powerpoint presentation | mister harbies (5607) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 489059 | 2006-10-04 03:34:00 | hi fellow f1ers, i wonder if there is a way to make a powerpoint presentation of a pub quiz using a database of questions and answers. Say i make a database with questions in 1 column and answers in the next. i import this into a powerpoint presentation and hav a quiz ready 2 use. answers would b displayed at the end. this would save me so much time rather than having to make each page and entering in all the questions and answers individually. Im talking like 100 questions, and doing this 10 times so thats 1000 pages. Mister Harbies |
mister harbies (5607) | ||
| 489060 | 2006-10-04 06:31:00 | Hi How about creating a report in your database that looks like a presentation slide? That could be achieved very easily and you then print it onto the transparent sheets. Is that an option? Andrew |
andrew93 (249) | ||
| 489061 | 2006-10-05 04:50:00 | Hi... No that does not really help. We would like to use this in a club and would like things looking professional. It seems a bit flimsy to use the overhead projector. There has to be a way to do this |
mister harbies (5607) | ||
| 489062 | 2006-10-05 08:58:00 | I've whipped together a quick script to make a quiz for you. It's a little complex but will do the job reasonably well. You can get the files here: goddard.net.nz It uses the Opera (http://www.opera.com) browser's presentation mode (you must have this installed on the presentation machine). I used Opera's presentation generator to make an initial copy then turned this into a template. To build the presentation you need to install the Ruby interpreter (www.ruby-lang.org). This is the language I mostly use. There is a one-click installer for Windows on the download page which also includes some useful tools such as a decent text editor. Now you need to edit the "quiz.yml" file using a text editor such as notepad or SciTE (this comes with the Ruby installer). You can add a logo or leave it as it is to not use one. You need to give it a title, organisation name, and a few other details. Don't change the indentation as this is significant for YAML files. Update only the fields you need to alter without changing the document's layout. You can leave the files section alone. Each question is on a line by itself in questions.txt and the corresponding answers in answers.txt. Make sure these are the same length. To build the quiz you just need to double click on "generate.rb". It should open a terminal window and will tell you whether or not it was successful. You should now be able to open the HTML file in Opera and press F11 to view it. The layout is just the Opera presentation generator's standard one. If you know how to write in HTML feel free to write a replacement and I can make it into a template easily. The Opera Show tutorial is useful: www.opera.com |
TGoddard (7263) | ||
| 489063 | 2006-10-05 09:08:00 | P.S. This was designed quickly and does very little error checking. If you have any problems, please just send me any error messages displayed and I can probably work it out. Also make sure you don't have any trailing blank lines in the questions or answers files. |
TGoddard (7263) | ||
| 489064 | 2006-10-06 04:20:00 | The ruby software is a massive 26mb! Im on dial up. Is this the interpreter I am supposed to download? Or is there a smaller file? Im gonna look into this whether its 26mb or smaller... it might just be worth it. But I will wait for a response from you whether there is a smaller file. |
mister harbies (5607) | ||
| 489065 | 2006-10-06 05:51:00 | The ruby software is a massive 26mb! Im on dial up. Is this the interpreter I am supposed to download? Or is there a smaller file? Im gonna look into this whether its 26mb or smaller... it might just be worth it. But I will wait for a response from you whether there is a smaller file. Does your quiz have multiple choice answers like:- Question 1. Whom is the Prime Minister of New Zealand? Answer. Helen Dagg Helen Clarke Bill Clinton Tony Blair Pick one of the above. Is the quiz 100 questions and to be printed for an audience of 10. They then answer the questions and someone answers "Helen". Only right if they pick the second Helen as it were. If we take it the other way and say there is one question and one answer OK. Question 1. Whom is the Prime Minister of New Zealand? Answer. "Helen Clarke." Someone now says, "Clarke" or writes it down on one of their 10 pages of 100 questions. Are they going to be right or wrong? Do you have input devices so your audience can select 1, 2, 3 or 4? To get over your dialup I am prepared to download all files mentioned by TGoddard for Ruby and Opera and post them to you for free. When you mention making a database in the first post what software would you use to make the database? I would think Access but I may be wrong. |
Sweep (90) | ||
| 489066 | 2006-10-06 11:06:00 | The 10MB package Ruby-1.8.5-Binary should also be able to run it but you might have to set up file associations and the like yourself. It will probably be harder to install. Let me know how it goes. | TGoddard (7263) | ||
| 489067 | 2006-10-07 00:59:00 | Hi, yes this is possible but would require code to achieve. PowerPoint does not have a mail merge facility nor objects/methods for database connection that I can see. However, you could have data from either a Table or Query in Access populated into an existing Ppt file or create a new one on the fly each time. The Data is therefore static and not connected to Access in any way - its just that the data in Access was used as the source info to create the presentation. The code would be run from Access. Things to consider are how many questions per slide etc as obviously a 1000 questions isnt going to fit on one slide unless youve got the hubble telescope at your disposal to read it. If I get time I will try and make something simple for you. regards, Graham |
Parry (5696) | ||
| 489068 | 2006-10-07 03:49:00 | Hi, heres some code that will create a new powerpoint presentation on the fly. Its just the bare bones but could easily be adapted to look at a specific template then add slides based on it. If you send me a PM with your email address I will send the database to you. If you want to add the code yourself to your existing database then follow the steps below. If I send you a db you will still need to complete step #3. 1) Create a table called Table1 in the database. The fields in this table and their data type are as follows... QuestionID... AutoNumber Question... Text Answer...Text 2) Create a Module. Click on the Module object then the New button. You will now be in the VB Editor. 3) Create a reference to the Microsoft PowerPoint Object Library. Select Tools - References then scroll down until you see Microsoft PowerPoint xxxx Object Library and put a tick in the box next to it where xxxx is a number. Click OK to close the Reference form. 4) Paste the code below into the right hand window. It may have lines that say Option Compare Database and/or Option Explicit - paste the code underneath these lines 5) Save & Close the VBEditor by selecting File | Close & Return to MS Access To run the code you can create a form with a command button on it. Sub Export_To_PowerPoint() Dim dbsCurrent As Database, Rs As Recordset, strTableName As String Dim intQuestionsPerPg As Integer, i As Integer, NxtSlide As Long Dim PpApp As PowerPoint.Application, PpPres As PowerPoint.Presentation Dim PpSlide_Header As PowerPoint.Slide, PpSlide As PowerPoint.Slide '************************************************* ***************************** '* Creates a powerpoint presentation from data in Table1 * '* Note requires the Microsoft PowerPoint Object library xxx to be referenced * '* via Tools | References. * '* Code by Graham Paramore 7 OCT 2006 * '************************************************* ***************************** 'Table name where data is being obtained from strTableName = " Table1 " 'Number of questions per slide intQuestionsPerPg = 5 'Initialize database variable and create a recordset Set dbsCurrent = Application.CurrentDb Set Rs = dbsCurrent.OpenRecordset(strTableName, dbOpenSnapshot, dbReadOnly) 'Open an instance of the PowerPoint application Set PpApp = CreateObject( " Powerpoint.Application " ) PpApp.Visible = True 'Create a new PowerPoint presentation Set PpPres = PpApp.Presentations.Add '---------------- QUESTIONS CODE ------------------ 'Add Header slide Set PpSlide = PpPres.Slides.Add(1, ppLayoutTitleOnly) PpSlide.Shapes(1).TextFrame.TextRange.Text = " Question Title Page " 'Add 1st Question Slide Set PpSlide = PpPres.Slides.Add(2, ppLayoutText) 'Set a variable for the first question in the slide NxtSlide = 1 Do While Not Rs.EOF 'increment counter i = i + 1 With PpSlide.Shapes(2).TextFrame.TextRange If .Text = " " Then 'If text is blank this is the first question in the Textbox 'so add Q#: and the question. .Text = " Q " & i & " : " & Rs.Fields(1) & " ? " Else 'If text isnt blank then add previous text then next question .Text = .Text & Chr$(CharCode:=13) & " Q " & i & " : " & Rs.Fields(1) & " ? " End If End With Rs.MoveNext 'if record is divisble by # pages then insert new page If i Mod intQuestionsPerPg = 0 Then 'Add title text to current slide before creating new slide With PpSlide.Shapes(1).TextFrame.TextRange .Text = " Questions " & NxtSlide & " - " & i End With NxtSlide = i + 1 'Add a new Question Slide Set PpSlide = PpPres.Slides.Add(PpPres.Slides.Count + 1, ppLayoutText) End If Loop 'Last slide doesnt have a title yet so add it With PpSlide.Shapes(1).TextFrame.TextRange .Text = " Questions " & NxtSlide & " - " & i End With '---------------- ANSWERS CODE ------------------ 'Add Header slide Set PpSlide = PpPres.Slides.Add(PpPres.Slides.Count + 1, ppLayoutTitleOnly) PpSlide.Shapes(1).TextFrame.TextRange.Text = " Answers Title Page " 'Add 1st Answer Slide Set PpSlide = PpPres.Slides.Add(PpPres.Slides.Count + 1, ppLayoutText) 'Initialize variables i = 0 NxtSlide = 1 'Move to the first record in the recordset Rs.MoveFirst Do While Not Rs.EOF 'increment counter i = i + 1 With PpSlide.Shapes(2).TextFrame.TextRange If .Text = " " Then 'If text is blank this is the first question in the Textbox 'so add Q#: and the question. .Text = " A " & i & " : " & Rs.Fields(2) Else 'If text isnt blank then add previous text then next question .Text = .Text & Chr$(CharCode:=13) & " A " & i & " : " & Rs.Fields(2) End If End With Rs.MoveNext 'if record is divisble by # pages then insert new page If i Mod intQuestionsPerPg = 0 Then 'Add title text to current slide before creating new slide With PpSlide.Shapes(1).TextFrame.TextRange .Text = " Answers " & NxtSlide & " - " & i End With NxtSlide = i + 1 'Add a new Question Slide Set PpSlide = PpPres.Slides.Add(PpPres.Slides.Count + 1, ppLayoutText) End If Loop 'Last slide doesnt have a title yet so add it With PpSlide.Shapes(1).TextFrame.TextRange .Text = " Answers " & NxtSlide & " - " & i End With End Sub regards, Graham |
Parry (5696) | ||
| 1 2 | |||||