Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: PowerPoint hide window

$
0
0
FYI, Sebastion you Rock!
Not sure what the differences are, but I had all kinds of issues with visibility etc ...
In my case I had Office 2007 Enterprise installed, however, when I looked at installed programs there were some 2003 components showing up. I was getting the same error as you. I had to uninstall those earlier components and reboot.
I found it by setting visibility to true, it opened the PowerPoint main UI with nothing opened because of the obvious error I kept getting. From that UI I then tried to open my file and it produced an error regarding the file was a newer version and couldn't open. That's what lead me to suspecting the earlier components on my system.

The below link as an FYI and code work fine for me, no visibility issues.
Regards
-Tom


Please see : This link

Imports NetOffice
Imports PowerPoint = NetOffice.PowerPointApi
Imports NetOffice.PowerPointApi.Enums
Imports NetOffice.OfficeApi.Enums


Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    LateBindingApi.Core.Factory.Initialize()
    Dim oPPTApp As PowerPoint.Application
    Dim oPPTPres As PowerPoint.Presentation
    Dim sFileName As String

    oPPTApp = New PowerPoint.Application
    sFileName = "E:\temp\New folder\NBUAnalyzerReport-Template2.pptx"
    oPPTPres = oPPTApp.Presentations.Open(fileName:=sFileName, [readOnly]:=MsoTriState.msoFalse, untitled:=MsoTriState.msoFalse, withWindow:=MsoTriState.msoFalse)
    Try
        With oPPTPres
            For Each slide As PowerPoint.Slide In .Slides
                For SlideIndex = slide.Shapes.Count To 1 Step -1

                    With slide.Shapes(SlideIndex)
                        Dim FolderWithImages = "Z:\temp\New folder\Images1\"
                        If .Type = MsoShapeType.msoLinkedPicture Then
                            If .Name = Dir(FolderWithImages + .Name) Then 'ensures file exists before updating!

                                .LinkFormat.SourceFullName = FolderWithImages + .Name
                                Debug.Print(.LinkFormat.SourceFullName)
                                .LinkFormat.Update()

                            Else

                            End If
                        End If

                    End With
                Next

            Next
            .Save()
        End With

    Catch ex As Exception
    Finally
        oPPTApp.Quit()
        oPPTApp.Dispose()
    End Try
    Application.Exit()
End Sub
End Class

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>