Re: PowerPoint slide popup with database linked

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In article <7624E108-6B53-4ACE-A41E-8A0D621013E9@xxxxxxxxxxxxx>, Jkhung426 wrote:
Hi Steve,

Thanks for your prompt reply.

I want to drive the data from a database server and not from the power point
it self.

So you want code in the database to update the PPT file? You'll need to rewrite your
code to some extent, since it's now more or less pulling data in rather than getting
data pushed AT ppt.

The code in the database wouldn't be much different, assuming the database supports VBA.
You'd set a reference to PowerPoint, instantiate PPT and automate it along these lines
...


Dim oPPTApp As PowerPoint.Application
Dim oPPTPres As PowerPoint.Presentation
Dim sPresentationFile as String
sPresentationFile = "C:\MyFiles\Somefile.PPT"

' Get a reference to PowerPoint app
Set oPPTApp = New PowerPoint.Application
' set it visible or you may get errors - there are ways around this but they're
' beyond the scope of this FAQ
oPPTApp.Visible = True
' minimize if you want to hide it:
' oPPTApp.WindowState = ppWindowMinimized

' Open our source PPT file, get a reference to it
Set oPPTPres = oPPTApp.Presentations.Open(sPresentationFile)

With oPPTPres
' your code to modify the presentation here
' oPPTPres is now equivalent to ActivePresentation if you were writing it
' directly from within PPT
End With

Dim oPopup As Shape
Dim oSl As Slide
Dim dOffset As Double
dOffset = 25

Set oSl = osh.Parent
' create a rectangle for the popup
Set oPopup = oSl.Shapes.AddShape(msoShapeRectangle, _
osh.Left + dOffset, _
osh.Top + dOffset, _
osh.Width + dOffset, _
osh.Height + dOffset)

' set popup shape properties here as needed
With oPopup
' fill
.Fill.ForeColor.RGB = RGB(255, 255, 200)
' text settings
With .TextFrame
.WordWrap = msoTrue
With .TextRange
' text color
.Font.Color.RGB = RGB(0, 0, 0)
.Text = "My text here that I like to pull from the database
server so it updates automatically."
End With
End With

End With
End Sub

The above codes works fine however, i would need to update the text I want
to show everytime when data changes. How would I incorporate this code to
pull data from a database so, everytime when data changes, the slide updates
are updated as well?

Thanks,

James

"Steve Rindsberg" wrote:

In article <D7797A36-77F5-40E7-9344-C30420E0326D@xxxxxxxxxxxxx>, Jkhung426 wrote:
Hi Steve,

I'm sorry for not being clear.

I have a global map with company logos. I have written a macro that is to
show a popup text box with pre-determined text when I mouse-over the logo
using the active settings.

Instead of updating the popup text content for each of the macros i have for
all the logos everytime when data is changed. I was wondering if anyone know
a way to link a database file to each of these popup text boxes. So, when
database is updated with new data. So will the content of my popup textbox...

Might still be simpler and faster to do the update from a text file. Reading and
writing simple files is blazingly fast.

You probably wouldn't need multiple macros.

If each shape is tagged with the pop-up text you want with code something like this:

With ActiveWindow.Selection.ShapeRange(1)
.Tags.Add "Popup", "some-name"
End With

The macro assigned to all popup shapes:

Sub ShowThePopup(oSh as Shape)
Dim sPopupText as String
sPopupText = GetText(oSh.Tags("Popup"))
' then do whatever you need to do to display the text
End Sub

Function GetText(sPopupName as String) as String
' Reads a text file line by line looking for sPopupName on the left side of the =
' and returns the value on the right side

' Or you could store all the text in an array/collection just once and
' pull it from there as needed.

End Function


The text file might look like:

Popup1=Here is the popup text for one of the shapes
Popup2=And here's some other text
Popup3=And so on ...


But if you visit http://www.pptfaq.com/ and search on the name "Naresh" (no quotes)
you'll find some example code for pulling data out of an Access database.

Do you want to drive the update from the database or from PowerPoint?



Your help is greatly appreciated! thanks!
"Steve Rindsberg" wrote:

In article <E64FDE93-8D09-4830-9874-63C4249AD7E8@xxxxxxxxxxxxx>, Jkhung426
wrote:
I have a powerpoint presentation that have a VBA module that is written to
show text within a pop-up when every time you mouse-over an image and click
on the popup textbox again to delete the pop-up from the slides.

My question is that I want to use this as a template and maybe figure out a
way to have database link to this text i have for the Pop-up. Because, every
month this text value changes and I like to maybe link it to a database so i
will not have to type in the value every month? Do you have any idea how i
can do this? thanks again...

Is there just the one instance of this? Pulling it out of database seems like
swatting a fly with a building.

What about having it read a text file instead. That'd be fairly simple.



==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/




==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/




==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/

.



Relevant Pages

  • Re: PowerPoint slide popup with database linked
    ... itself or from the PPT? ... Probably from the database, as it's a fairly simple mod of your existing code. ... Dim oPPTPres As PowerPoint.Presentation ... ' set popup shape properties here as needed ...
    (microsoft.public.powerpoint)
  • Re: PowerPoint slide popup with database linked
    ... I want to drive the data from a database server and not from the power point ... Dim dOffset As Double ... ' set popup shape properties here as needed ... If each shape is tagged with the pop-up text you want with code something like this: ...
    (microsoft.public.powerpoint)
  • Re: 2 users cant add records at same time
    ... > they can double click a textbox & a popup form with 2 subforms will open. ... Put the backend mdbon the ... Since your database is secured, don't use the database splitter wizard, as ...
    (microsoft.public.access.security)
  • Re: PowerPoint slide popup with database linked
    ... itself or from the PPT? ... I want to drive the data from a database server and not from the power point ... Dim oPPTPres As PowerPoint.Presentation ... ' set popup shape properties here as needed ...
    (microsoft.public.powerpoint)
  • Re: PowerPoint slide popup with database linked
    ... I have a global map with company logos. ... show a popup text box with pre-determined text when I mouse-over the logo ... a way to link a database file to each of these popup text boxes. ... The macro assigned to all popup shapes: ...
    (microsoft.public.powerpoint)