Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSingle Sign on Pin
berba18-Jun-10 2:59
berba18-Jun-10 2:59 
AnswerRe: Single Sign on Pin
Dave Kreskowiak18-Jun-10 8:06
mveDave Kreskowiak18-Jun-10 8:06 
GeneralRe: Single Sign on Pin
berba22-Jun-10 23:15
berba22-Jun-10 23:15 
GeneralRe: Single Sign on Pin
Dave Kreskowiak23-Jun-10 1:33
mveDave Kreskowiak23-Jun-10 1:33 
QuestionPowerPoint Application Pin
rdop18-Jun-10 1:13
rdop18-Jun-10 1:13 
AnswerRe: PowerPoint Application Pin
ddecoy18-Jun-10 1:16
ddecoy18-Jun-10 1:16 
GeneralRe: PowerPoint Application Pin
rdop18-Jun-10 1:36
rdop18-Jun-10 1:36 
GeneralRe: PowerPoint Application Pin
JR21218-Jun-10 2:13
JR21218-Jun-10 2:13 
what do you think of this
Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const ERR_NO_WINDOW_HANDLE As Long = 1000
Const ERR_WINDOW_LOCK_FAIL As Long = 1001
Const ERR_VERSION_NOT_SUPPORTED As Long = 1002

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long

Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long


Sub sOpenPowerpoint()
  Dim pPT As PowerPoint.Application
  Dim pPTopen As PowerPoint.Presentation
  Dim PptName As String
  PptName = "C:\A\Nice.pptx"
  Set pPT = CreateObject("PowerPoint.Application")
  pPT.Visible = True
  Set pPTopen = pPT.Presentations.Open(PptName)
  nHandle = fHandle
  ShowWindow nHandle, SW_HIDE
End Sub

Function fHandle() As Long

  Static hwnd As Long
  Dim VersionNo As String

' Get Version Number

    VersionNo = Left(Application.Version, InStr(1, Application.Version, ".") - 1)

' Get handle to the main application window using ClassName

    Select Case VersionNo
    Case "8"  ' For PPT97:
        hwnd = FindWindow("PP97FrameClass", 0&)
    Case "9"  ' For PPT2K:
        hwnd = FindWindow("PP9FrameClass", 0&)
    Case "10" ' For XP:
        hwnd = FindWindow("PP10FrameClass", 0&)
    Case "11" ' For 2003:
        hwnd = FindWindow("PP11FrameClass", 0&)
    Case "12" ' For 2007:
        hwnd = FindWindow("PP12FrameClass", 0&)
    Case Else
        Err.Raise Number:=vbObjectError + ERR_VERSION_NOT_SUPPORTED, _
        Description:="Supported for PowerPoint 97/2000/2002/2003 only."
        Exit Function
    End Select

    If hwnd = 0 Then
        Err.Raise Number:=vbObjectError + ERR_NO_WINDOW_HANDLE, _
        Description:="Unable to get the PowerPoint Window handle"
        Exit Function
    End If

    If LockWindowUpdate(hwnd) = 0 Then
        Err.Raise Number:=vbObjectError + ERR_WINDOW_LOCK_FAIL, _
        Description:="Unable to set a PowerPoint window lock"
        Exit Function
    End If
  fHandle = hwnd
      
End Function

GeneralRe: PowerPoint Application Pin
EliottA18-Jun-10 2:27
EliottA18-Jun-10 2:27 
GeneralRe: PowerPoint Application Pin
JR21218-Jun-10 20:38
JR21218-Jun-10 20:38 
GeneralRe: PowerPoint Application [modified] Pin
MsmVc18-Jun-10 2:31
MsmVc18-Jun-10 2:31 
GeneralRe: PowerPoint Application Pin
EliottA18-Jun-10 2:33
EliottA18-Jun-10 2:33 
GeneralRe: PowerPoint Application [modified] Pin
MsmVc18-Jun-10 2:42
MsmVc18-Jun-10 2:42 
GeneralRe: PowerPoint Application Pin
JR21221-Jun-10 3:36
JR21221-Jun-10 3:36 
Questionnewbie question on updating Access mdb tables Pin
john12617-Jun-10 5:46
john12617-Jun-10 5:46 
QuestionRe: newbie question on updating Access mdb tables Pin
DaveAuld17-Jun-10 6:26
professionalDaveAuld17-Jun-10 6:26 
QuestionRe: newbie question on updating Access mdb tables Pin
john12617-Jun-10 6:36
john12617-Jun-10 6:36 
AnswerRe: newbie question on updating Access mdb tables [modified] PinPopular
AnnieMacD17-Jun-10 7:24
AnnieMacD17-Jun-10 7:24 
GeneralRe: newbie question on updating Access mdb tables Pin
john12617-Jun-10 8:49
john12617-Jun-10 8:49 
GeneralRe: newbie question on updating Access mdb tables Pin
AnnieMacD17-Jun-10 11:26
AnnieMacD17-Jun-10 11:26 
QuestionAdd Combobox to Datagridview at runtime. Pin
Nielvh17-Jun-10 4:35
Nielvh17-Jun-10 4:35 
AnswerRe: Add Combobox to Datagridview at runtime. Pin
dan!sh 17-Jun-10 5:43
professional dan!sh 17-Jun-10 5:43 
GeneralRe: Add Combobox to Datagridview at runtime. Pin
Nielvh18-Jun-10 11:18
Nielvh18-Jun-10 11:18 
QuestionPassing Events Pin
Sonhospa17-Jun-10 3:11
Sonhospa17-Jun-10 3:11 
AnswerRe: Passing Events Pin
EliottA17-Jun-10 3:49
EliottA17-Jun-10 3:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.