TrippyTom
12-04-2006, 10:30 AM
In the following link, Ken Puls shows how to determine Screen Resolution inside Excel. http://www.vbaexpress.com/forum/showthread.php?t=10321&highlight=screen+size
Does anyone know a similar way to do it in PowerPoint?
I'm trying to place my toolbar in the bottom right of my screen, but I have to figure out the resolution first. Here's the part of my code that I tried:
MsgBox (ActivePresentation.WebOptions.ScreenSize)
If ActivePresentation.WebOptions.ScreenSize = msoScreenSize800x600 Then
cmdBar.Left = 760
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1024x768 Then
cmdBar.Left = 984
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1152x882 Then
cmdBar.Left = 1112
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1152x900 Then
cmdBar.Left = 1112
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1280x1024 Then
cmdBar.Left = 1240
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1600x1200 Then
cmdBar.Left = 1560
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1800x1440 Then
cmdBar.Left = 1760
End If
But the value is coming back as "3" for some reason, and it's triggering only the first IF condition.
[edit:] -- Apparently "3" is the constant for 800x600, but I have no idea why it's triggering that because my resolution is at 1600x1200. Very strange. :(
Does anyone know a similar way to do it in PowerPoint?
I'm trying to place my toolbar in the bottom right of my screen, but I have to figure out the resolution first. Here's the part of my code that I tried:
MsgBox (ActivePresentation.WebOptions.ScreenSize)
If ActivePresentation.WebOptions.ScreenSize = msoScreenSize800x600 Then
cmdBar.Left = 760
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1024x768 Then
cmdBar.Left = 984
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1152x882 Then
cmdBar.Left = 1112
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1152x900 Then
cmdBar.Left = 1112
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1280x1024 Then
cmdBar.Left = 1240
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1600x1200 Then
cmdBar.Left = 1560
ElseIf ActivePresentation.WebOptions.ScreenSize = msoScreenSize1800x1440 Then
cmdBar.Left = 1760
End If
But the value is coming back as "3" for some reason, and it's triggering only the first IF condition.
[edit:] -- Apparently "3" is the constant for 800x600, but I have no idea why it's triggering that because my resolution is at 1600x1200. Very strange. :(