0 Replies - 552 Views - Last Post: 05 February 2018 - 05:41 AM Rate Topic: -----

#1 topsykretts   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 18-January 12

How to close opened pdf document

Posted 05 February 2018 - 05:41 AM

Hello to all,
I have 5 pdf documents opened in 5 tabs in Adobe Reader.
Let's say that I want to replace one of them. So, I have to close it before.
Is it possible to close some of them through VB.Net?

What I have tried:

For example I choosed 444444.pdf. I have tried:
' close the pdf file if opened
        Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("AcroRd32")
        For Each pOpened As Process In pProcess
            If pOpened.MainWindowTitle.Contains(444444.pdf) Then
            End If

This works only if 444444.pdf is opened and also if it is currently active tab.
If 444444.pdf is opened but not active - doesn't work.

Is it possible also just to close tab, without killing process?
If it's so complicated just to close tab then killing process is acceptable for me.

What do you suggest?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1