Click here to Skip to main content
15,914,642 members
Home / Discussions / COM
   

COM

 
GeneralRe: Get ProgID or CLSID if i have only pointer to some IDispatch interface Pin
IWannaTalk29-Oct-07 6:52
IWannaTalk29-Oct-07 6:52 
GeneralRe: Get ProgID or CLSID if i have only pointer to some IDispatch interface Pin
User 21559729-Oct-07 7:26
User 21559729-Oct-07 7:26 
GeneralRe: Get ProgID or CLSID if i have only pointer to some IDispatch interface Pin
IWannaTalk29-Oct-07 7:40
IWannaTalk29-Oct-07 7:40 
GeneralRe: Get ProgID or CLSID if i have only pointer to some IDispatch interface Pin
Nathan Holt at EMOM29-Oct-07 9:42
Nathan Holt at EMOM29-Oct-07 9:42 
QuestionHow I Can have the id for html control in webpage Pin
Thaer Hamael25-Oct-07 11:59
Thaer Hamael25-Oct-07 11:59 
AnswerRe: How I Can have the id for html control in webpage Pin
User 21559725-Oct-07 12:10
User 21559725-Oct-07 12:10 
QuestionMake a Container for RICHTX32.OCX Pin
AhmedOsamaMoh24-Oct-07 7:10
AhmedOsamaMoh24-Oct-07 7:10 
QuestionPowerpoint Automation, process won't quit Pin
T-Smooth23-Oct-07 9:43
T-Smooth23-Oct-07 9:43 
I'm trying to do some Powerpoint automation from an ASP.NET page and generate/modify a slide. That piece of the code works fine but when it's all done running and even after I call the Quit() method on the powerpoint application object, POWERPOINT.EXE remains running and eventually this is causing problems. I've googled this extensively and nothing I've found has seemed to help. I really need this to work properly.

Here's my relevant code. I don't believe i'm using any Global references and I've even removed the COM reference from my website to use Late Binding instead in hopes that it would solve my problems as mentioned in this MSDN Article: http://support.microsoft.com/default.aspx?scid=kb;en-us;319832

Code:
Public Function GenerateDrillDown(ByVal strFileName As String) As Boolean<br />
  Dim App As Object = Nothing<br />
  Dim pres As Object = Nothing<br />
  Dim slide As Object = Nothing<br />
<br />
  Try<br />
    App = CreateObject("PowerPoint.Application")<br />
    App.Visible = -1 '  For debugging. Comment this out or set to 0 to keep the application from being visible.<br />
<br />
    pres = App.Presentations.Open("C:\DevProjects\Docs\DrillDown.ppt", 0, -1, -1)<br />
    slide = pres.Slides(1) ' There's only one slide in this ppt i'm using as the template.<br />
<br />
    slide.Shapes.Item("Text Box 8").TextFrame.TextRange.Text = DecisionTitle ' These are all string variables<br />
    slide.Shapes.Item("Text Box 13").TextFrame.TextRange.Text = Narrative<br />
    slide.Shapes.Item("Text Box 14").TextFrame.TextRange.Text = Issues<br />
    slide.Shapes.Item("Text Box 19").TextFrame.TextRange.Text = Scope<br />
<br />
    If TopicType = 1 Then<br />
     slide.Shapes.Item("Autoshape 9").TextFrame.TextRange.Text = IDNumber.ToString()<br />
     slide.Shapes.Item("Autoshape 9").Visible = -1<br />
     slide.Shapes.Item("Autoshape 56").Visible = 0<br />
    ElseIf TopicType = 2 Then<br />
      slide.Shapes.Item("Autoshape 56").TextFrame.TextRange.Text = "ST" & IDNumber.ToString()<br />
      slide.Shapes.Item("Autoshape 56").Visible = -1<br />
      slide.Shapes.Item("Autoshape 9").Visible = 0<br />
    End If<br />
<br />
    pres.SaveAs(strFilename, 1, 0)<br />
  Catch ex As Exception<br />
    Return False<br />
   Finally<br />
     ' Most of this is coming from another article I found online to help combat the problem of open references with office automation.<br />
     GC.Collect()<br />
     GC.WaitForPendingFinalizers()<br />
     GC.Collect() ' Intentionally repeated<br />
     GC.WaitForPendingFinalizers() <br />
     If Not slide Is Nothing Then<br />
      Marshal.FinalReleaseComObject(slide)<br />
      slide = Nothing<br />
     End If<br />
    <br />
    If Not pres Is Nothing Then<br />
      pres.Close()<br />
      Masrhal.FinalReleaseComObject(pres)<br />
      pres = Nothing<br />
    End If<br />
    <br />
    If Not App Is Nothing Then<br />
      App.Quit()  ' This doesn't do anything, no errors but ap stays open<br />
      Marshal.FInalReleaseComObject(App)<br />
      App = Nothing<br />
    End If<br />
  End Try<br />
<br />
  Return True<br />
End Function


Please give me some guidance as this is an important piece of functionality required by my project. Thanks!
QuestionVST host in C# Pin
newtownz23-Oct-07 4:32
newtownz23-Oct-07 4:32 
AnswerRe: VST host in C# [modified] Pin
Baltoro25-Oct-07 10:39
Baltoro25-Oct-07 10:39 
AnswerRe: VST host in C# Pin
Obiwan Jacobi6-Sep-09 19:17
Obiwan Jacobi6-Sep-09 19:17 
QuestionCOM Component Pin
Shaileshvb23-Oct-07 0:02
Shaileshvb23-Oct-07 0:02 
AnswerRe: COM Component Pin
charlieg23-Oct-07 4:48
charlieg23-Oct-07 4:48 
GeneralRe: COM Component Pin
Prasann Mayekar24-Oct-07 2:22
Prasann Mayekar24-Oct-07 2:22 
AnswerRe: COM Component Pin
Arindam Tewary26-Oct-07 23:57
professionalArindam Tewary26-Oct-07 23:57 
QuestionVBScript to activeX to VBScript example needed - earn some beer Pin
charlieg22-Oct-07 11:40
charlieg22-Oct-07 11:40 
AnswerRe: VBScript to activeX to VBScript example needed - earn some beer Pin
CPallini22-Oct-07 21:46
mveCPallini22-Oct-07 21:46 
GeneralRe: VBScript to activeX to VBScript example needed - earn some beer Pin
charlieg23-Oct-07 4:56
charlieg23-Oct-07 4:56 
GeneralRe: VBScript to activeX to VBScript example needed - earn some beer Pin
CPallini23-Oct-07 8:11
mveCPallini23-Oct-07 8:11 
AnswerRe: VBScript to activeX to VBScript example needed - earn some beer Pin
Vi229-Oct-07 18:44
Vi229-Oct-07 18:44 
GeneralRe: VBScript to activeX to VBScript example needed - earn some beer Pin
charlieg1-Nov-07 1:06
charlieg1-Nov-07 1:06 
GeneralRe: VBScript to activeX to VBScript example needed - earn some beer Pin
Vi21-Nov-07 5:50
Vi21-Nov-07 5:50 
QuestionDocumentComplete and reload Pin
conman11022-Oct-07 8:04
conman11022-Oct-07 8:04 
AnswerRe: DocumentComplete and reload Pin
conman11022-Oct-07 8:23
conman11022-Oct-07 8:23 
QuestionRe: DocumentComplete and reload Pin
shivditya22-Oct-07 19:56
shivditya22-Oct-07 19:56 

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.