Powerpoint to Visio and vice versa

B

bcoonce

Have a hyperlinked Powerpoint presentation mimicking a User Interface page
flow (linear slide progression turned off) and would like to be able to look
at this page flow at a macro level through something like a Visio flow chart;
where each slide is a panel of the flow chart and the hyperlinks are
represented by the organizational lines/arrows of the a common Visio diagram.

Or...

Create a flow chart in Visio, and export it to a hyperlinked Powerpoint
presentation

The goal to to be able to look at the organization of the User Interface
from a production/design level, ala Visio, and still quickly walkthrough it
as a user via Powerpoint

Any suggestions? (can anyone recommend other solutions if this is not
possible?)
 
A

Al Edlund

you can do it (export a visio document to powerpoint) in vba with something
like this

al


Public Sub subGeneratePowerPoint()

Dim visDocument As Visio.Document
Dim visPage As Visio.Page

Dim ppApp As PowerPoint.Application
Dim ppSlide As PowerPoint.Slide
Dim iObjCtr As Integer
Dim iConCtr As Integer
Dim iPagCtr As Integer
Dim strForeground As String
Dim strBackground As String
Dim shpGroup As Visio.Shape

Const MAX_SLIDES As Long = 250
Const DEFAULT_AUTO_LAYOUT As Long = ppLayoutBlank
Dim lLastSlide As Long
lLastSlide = 1
Dim lToCreate As Long
lToCreate = 10
Dim lResult As Long
Dim Continue As Boolean
Dim strResult As String

On Error GoTo powerpoint_err
Err.Clear

Set visDocument = Visio.ActiveDocument

' start powerpoint
Set ppApp = New PowerPoint.Application
' make it visible
ppApp.Visible = True
' create the presentation
Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Add(msoTrue)

lLastSlide = ppPres.Slides.Count

'first we create the pages in the presentation
For iPagCtr = 1 To visDocument.Pages.Count
' we dont want to include the background slides
If visDocument.Pages(iPagCtr).Background = False Then
lLastSlide = lLastSlide + 1
ppPres.Slides.Add lLastSlide, ppLayoutBlank
If Err.Number <> 0 Then
strResult = "Unable to add new slides " &
Err.Description
MsgBox strResult, vbCritical, "Error Adding Slides"
End
End If ' test for slide being created
End If ' test for background
Next iPagCtr

' now we populate the pages in the presentation
For iPagCtr = 1 To visDocument.Pages.Count
' Debug.Print "powerpoint page " & iPagCtr
strForeground = ""
strBackground = ""
If visDocument.Pages(iPagCtr).Background = False Then
' move page to active window
strForeground = visDocument.Pages(iPagCtr).Name
ActiveWindow.Page = strForeground
ActiveWindow.SelectAll

ActiveWindow.Group

Set shpGroup = ActivePage.Shapes.item(ActivePage.Shapes.Count)
' Debug.Print "powerpoint objects " & ActivePage.Shapes.Count
' copy selected items to clipboard
ActiveWindow.Copy
' Debug.Print "copied"
' Paste Visio drawing from the clipboard to Powerpoint correct
slide
ppPres.Slides.item(iPagCtr).Shapes.Paste
' now paste the page name into the slides footer as a label
ppPres.Slides.item(iPagCtr).HeadersFooters.Footer.Text =
strForeground
DoEvents
' Debug.Print "pasted"
' now let's ungroup them
shpGroup.Ungroup
' Debug.Print "ungrouped"
' deselect the objects so we dont get confused
ActiveWindow.DeselectAll
' give the system back some time to get things done
End If
DoEvents
Next iPagCtr

powerpoint_exit:
Exit Sub

powerpoint_err:

If Err <> 0 Then
Debug.Print "Error in powerpoint " & Err & " " & Err.Description
Err.Clear
Resume Next
End If


End Sub
 
B

bcoonce

Thanks for the info Al,
I was able to get this to work, however, its not quite what i was looking
for.

It allowed me to export each Visio page as a slide in a powerpoint
presentation (which is handy!), but what I really would love to have is a
function that would create a PP slide from each visio object within a page,
and hyperlink each slide based on the data flow object links.

Do you think that's possible? would you happen to have an example in VBA to
do something like this (sorry, i'm not a programmer to work this through
myself, nor do i have easy access to one)

Any help would be appreciated! Thanks again
 
A

Al Edlund

the good news is that you would only have to create an additional inner loop
(for each shape in page, etc) with the necessary logic to filter out the
unwanted (like those lines that constantly get in the way of object logic)
and then attach a hyper link to the page (that would have to be something a
power point person would have to help you with).
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top