Re: PowerPoint slide popup with database linked
- From: jkhung426 <jkhung426@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Apr 2009 15:46:01 -0700
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.
Here's the code that I've been using for the text pop-up:
Sub Popup(osh As Shape)
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/
- Follow-Ups:
- Re: PowerPoint slide popup with database linked
- From: Steve Rindsberg
- Re: PowerPoint slide popup with database linked
- References:
- PowerPoint slide popup with database linked
- From: jkhung426
- Re: PowerPoint slide popup with database linked
- From: Steve Rindsberg
- Re: PowerPoint slide popup with database linked
- From: jkhung426
- Re: PowerPoint slide popup with database linked
- From: Steve Rindsberg
- PowerPoint slide popup with database linked
- Prev by Date: Re: Printing animated slides
- Next by Date: Re: every time i run a video file the progame gets an mfi error
- Previous by thread: Re: PowerPoint slide popup with database linked
- Next by thread: Re: PowerPoint slide popup with database linked
- Index(es):
Relevant Pages
|