MS Office Forum / Word / Programming / November 2005
Want to use Word for Office Assistant text in PowerPoint
|
|
Thread rating:  |
DJ - 01 Nov 2005 05:18 GMT I need to create a help file for a PowerPoint file and I would like to use the Office Assistant to display the help text. I want to store the text for the Assistant in a in Word document by the same name as the PPT file. I choose Word because I can't see how I can use PowerPoint and at least in Word it will print nicely. My table in Word will have 3 columns.
1. The step number 2. The heading, i.e., Printing 3. The help text or the actual steps to follow
I am new to VBA. I've never written code before. But I'm a good copy and paster! Can anyone help me get started, please? I am doing something similar in Excel where I am using code written by J. Walkenbach and storing the text in a hidden sheet so I know it can be done.
Any help, leads, suggestions will be greatly appreciated. DJ
Tony Jollans - 01 Nov 2005 09:52 GMT Hi DJ,
The fact that you want to use it with the Office Assistant in PowerPoint doesn't seem relevant unless you're looking for alternative ways of doing what you want, in which case you should ask in a PowerPoint newsgroup.
If I understand correctly, you want to create a table in Word. You don't need VBA for that; just open a Word document, create a table, enter your data.
The fact that Excel has a capacity to hide sheets does not imply anything at all about Word but what, exactly, is it that you do want to hide, and from whom, and why?
Sorry if I'm being really dumb but I don't understand what you're asking.
-- Enjoy, Tony
> I need to create a help file for a PowerPoint file and I would like to use > the Office Assistant to display the help text. I want to store the text for [quoted text clipped - 13 lines] > Any help, leads, suggestions will be greatly appreciated. > DJ DJ - 06 Nov 2005 02:56 GMT Thank Tony for your reply.
My objective is not to create a table in Word. My objective is to create a help file for PowerPoint. The help file will tell uses how to do things in the application like, import data, use custom animation, create custom shows and so on. I want to communicate with the user by way of the Office Assistant. The Assistant will display "Step one, click here... Step two, click there." I've done this in Excel. When you click a button I created in Excel, the Assistant appears and tell you step-by-step how to filter data or how to use the Analysis Toolpak, etc. In Excel, my help text is on a hidden sheet and with Visual Basic, I am displaying the content of that sheet in Office Assistant balloons. That's what I'm trying to do in PowerPoint. I mentioned the Word table as a consideration for where to store the help text. I don't have the option of purchasing a true Help System like RoboHelp so I have to be creative.
Thanks again for your consideration, DJ
Tony Jollans - 06 Nov 2005 10:56 GMT Hi DJ,
So what you have in Excel is all within Excel - the Assistant displays there in response to a button there and pulls information from within Excel as well. All relatively straightforward.
I don't know PowerPoint well enough to know whether there is any kind of equivalent to a hidden sheet where you can store your data but, as you are looking at using a Word document I presume you have investigated and found that there isn't.
If you are going to store your infomation in Word, you will need to access a (hidden) instance of Word to read the document. As an aside, if you already have code to access similar data from Excel, you could just as easily use a hidden instance of Excel as your data source.
Assuming you have set up your Word document then something like this will allow you to access it from PowerPoint
Dim appWord as Word.Application Dim docWord as Word.Document Dim tabWord as WordTable Set rowWord as WOrd.Row Set strHeading as String
Set appword = CreateObject("Word.application") Set docWord = appWord.Open "C:\The Path\To Your\Document.doc") Set tabWord = docWord.Content.Tables(1)
Set rowWord = tabWord.Rows(22) ' <=== Whatever Row you want ' If rows don't correspond to ID numbers the above might require a Find - it's your data, I don't know
strHeading = rowWord.Cells(2).Range.Text strHeading = Left$(strHeading, Len(strHeading)-2) ' <=== strip off end of cell mark
' extract data in similar fashion - I don't know how it's organised
' etc. etc. - react to user .. and when you're done ...
set rowWord = Nothing Set tabWord = Nothing docWord.Close set docWord = Nothing appWord.Quit Set appWord = Nothing
(Apologies in advance if I have made any typos - I hope they're obvious) You will need a reference to the Word Library (Tools > References > check Microsoft Word x.x Library)
I hope I've understood and that is along the right lines to get you going. If not, do come back.
-- Enjoy, Tony
> Thank Tony for your reply. > [quoted text clipped - 14 lines] > Thanks again for your consideration, > DJ DJ - 17 Nov 2005 07:18 GMT Wow. Thanks!
Before I try it, I have a question. You mentioned I could just as easily use Excel to store my text in a hidden sheet. Can you change the code for Excel? I would prefer to use Excel since I'm using for my other help files. Besides, that way I can use multiple sheets in one workbook for multiple, related, PowerPoint files.
Data organization in Excel - The sheets are named Help 01, Help 02, etc. * - The first row contains some text that is not to be displayed by the Assistant - B2 contains the column label "Help Topic" - C2 contains the column label "Help Text" - A2 contains "1". A3 contains "2" and so on down the column - Column B, starting at B3, contains the help topics - Column C, starting at C3, contains the help text
* Help 01 and Help 02 are in the same workbook because the two PPT files they help you with are related and will be opened one after another in the same session.
Is that enough to work with? I very much appreciate you looking at this for me.
DJ
Tony Jollans - 17 Nov 2005 18:05 GMT The equivalent in Excel is along theses lines ...
Once again, just typed in so beware of typos but this is the sort of skeleton you need. I don't know what you got off JWalk but I assume you have code which does Lookups or Finds or whatever you need so you should be able to define your ranges given the sheet object and take it from there.
Dim appExcel as Excel.Application Dim bookExcel as Excel.Workbook Dim sheetExcel as Excel.Worksheet
Set appExcel = CreateObject("excel.application") Set bookExcel = appexcel.Open "C:\The Path\To Your\workbook.xls") Set sheetExcel = bookExcel sheets("Help 01")
' Put your code here - sheetexcel is a reference to your help sheet
Set sheetExcel = Nothing bookExcel .Close set bookExcel = Nothing appExcel.Quit Set appexcel = Nothing
-- Enjoy, Tony
> Wow. Thanks! > [quoted text clipped - 22 lines] > > DJ DJ - 30 Nov 2005 05:26 GMT Thank you Tony for the code and for your patience. It takes me so long to write back because, as silly as it sounds, I can never find this forum without the benefit of History so I can only access this thread at the computer on which I started it. I've sent myself a link. That should help.
The first thing I'm running into is a compile error, "User-defined type not defined" and appExcel As Excel.Application is highlighted at the top of the code. I'm wondering if a type library is not properly registered, but I don't know which one to focus on. Any suggestions?
I'm sure there will be another hurdle to overcome after this one especially since I don't claim to know VB.
I meant to ask you, would it help if I posted the code that provides the help text for my Excel files? It's been modified a bit since John's original code in his book.
I hope you had a nice holiday!
DJ
Graham Mayor - 30 Nov 2005 06:54 GMT > Thank you Tony for the code and for your patience. It takes me so > long to write back because, as silly as it sounds, I can never find > this forum without the benefit of History so I can only access this > thread at the computer on which I started it. I've sent myself a > link. That should help. See http://www.gmayor.com/MSNews.htm and access the group the way most of us do. This one is microsoft.public.word.vba.general
 Signature <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP
My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Tony Jollans - 30 Nov 2005 07:59 GMT Hi DJ,
I could always find my way back here - it was just so painful, I rarely bothered. I did have problems with Microsoft's Passport stuff which never got resolved - the last reply I had from MS was that they would get back to me when they had resolved the problem - of course they never did and I don't suppose they ever will. It is only since Graham kindly pointed me to his instructions on how to do it properly that I have started participating (and no longer need a passport id) - I warn you, though, it becomes addictive :-)
For the definitions to work, you need to have a reference to Microsoft Excel n.n Object Library. (where n.n is the version 11.0 for Office 2003, 10.0 for XP, etc.). Or you can define the Excel variables as "Object" but it is harder to work with that way - especially for a beginner.
If you have further problems it might help to post the code - or some of it, depending on how long it is. See how you get on - but _do_ come back if you're stuck; in your own time of course.
-- Enjoy, Tony
> > Thank you Tony for the code and for your patience. It takes me so > > long to write back because, as silly as it sounds, I can never find [quoted text clipped - 14 lines] > Word MVP web site http://word.mvps.org > <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
|
|
|