Problem opening PDF file email attachment in Edge (Default PDF) from my App

Hello, 

     In our org systems, MS Edge is set as the default PDF viewer. PDF files of a local user are opened smoothly. I have an app in VB.NET where any user can login to their account and access their emails.

     User named "UserX" is logged in the app. The app retrieves the UserX's profile and opens Outlook with all of the emails successfully. When the user tries to open email attachment of PDF type, Edge opens and displays error :

Hmmm...can’t reach this page

Try this

Make sure you’ve got the right web address: file:///C:/Users/

     

   I gave Read/Write access to UserX for folder  "C:/Users/but doesn't work. Still gives the same error. I looked online, but couldn't get any appropriate results for this kind of situation. I am stuck on this situation from past several days.

   Can anyone give suggestions on how to resolve this issue. Any help is highly appreciated.

Thanks, 

Tom 

  

Dear Tom,

I am an independent advisor, and I am trying to help other users in Community using my experience with Microsoft products.

Sometimes cookies and cache can cause such problem. Please test this in Microsoft Edge and Internet Explorer in Private (CTRL+SHIFT+P)

If you will still get error message please provide the screenshot of it. In this thread you will find tips on how to insert screenshot into message https://answers.microsoft.com/en-us/windows/for...

Also please provide the OS version taht you are using and if this is happening only on one PC or several.

Looking forward to your reply l.
Regards,
LA
***I'm an independent advisor and I don't work for Microsoft***

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank for your response, LA.

I tried the following:

  • executing Edge In Private,
  • gave Permission "Full Control" to UserX
  • Shared C:/Users/ with R/W with UserX

The result is same:

I try my app on 2 systems, on double clicking pdf file :

  • On 1 system, I get the above results
  • On 2nd system, when I double click the pdf attachment I don't get any results i.e. even Edge is not opened, no message dialog or any notification. So, I can't figure out what's going on over here. But, when I right click and select Quick Print -> MS Edge, it shows this error dialog :

I am on Win 10 Pro systems.

FYI, I would also like to share the code through which I launch the Outlook form my app. May be, some changes over there be helpful:

   '''

    ''' Launches Outlook

    '''

    ''' User's username.

    ''' User's password in the form of a SecureString.

    ''' User's domain name

    Private Sub LaunchOutlook(ByVal UserName As String, ByVal SecurePassword As SecureString, ByVal Domain As String)
        Log.Add("LaunchOutlook: UserName " & UserName & " SecurePass Length: " & SecurePassword.Length & " Domain: " & Domain)
        Dim OutlookProcess() As Process = System.Diagnostics.Process.GetProcessesByName("outlook")

        '' TD - 2/19/2019

        '' If Outlook instance is running, restores it

        If OutlookProcess.Count > 0 Then

            Dim mainWnd As IntPtr = OutlookProcess(0).MainWindowHandle

            Try

                ' For new (compatible) systems

                ShowWindow(mainWnd, 1) ' Restores minimized window, but not bring to front  - 9 (Restore), 1 (Normal), 5 (Show), 3 (Max)

                BringWindowToTop(mainWnd)

            Catch ex As Exception

                ' For old (incompatible) systems

                ShowWindow(mainWnd, 3)  ' Supports to open in Maximize state only

                SetForegroundWindow(mainWnd)

            Finally

                OutlookProcess = Nothing

                mainWnd = Nothing

            End Try

            Return

        End If

        Dim PSI As ProcessStartInfo = Nothing

        Try

            PSI = New ProcessStartInfo
            PSI.UserName = UserName
            PSI.Password = SecurePassword
            PSI.Domain = Domain
            Dim path As String = GetOutlookPath()

            '' Added WorkingDirectory

            PSI.WorkingDirectory = IO.Path.GetPathRoot(path)

            PSI.FileName = path & My.Settings.OutlookAppExe

            PSI.Arguments = My.Settings.OutlookAppArgs

            PSI.LoadUserProfile = True

            PSI.UseShellExecute = False

            If (IsNothing(OutlookProc)) Then

                OutlookProc = New Process()

            End If

            OutlookProc.StartInfo = PSI

            OutlookProc.Start()


        Catch ex As Exception

            Log.Add("LaunchOutlook Failed: " & ex.Message)

            Throw New Exception("Unable to launch Outlook: " & ex.Message)

        Finally

            If (Not IsNothing(OutlookProc)) Then

                OutlookProc.Close()

            End If

            PSI = Nothing

            OutlookProc = Nothing

        End Try


               Return

    End Sub

Btw, the systems are also under security restrictions. According to my Sr. that shouldn't affect this situation, yet something might be need to check or make clear.

Hope this helps. If you need any more info, please let me know.

Thanks, 

Tom

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Dear Tom,

Thank you for detailed explanation, however I will need to ask for some clarification. Sorry for inconvenience caused.

So this error occurs every time when UserX is trying to view any PDF ? Has this started recently or this is the first time you have tried this ? If this was working previously, than what changed? Also what app you mean exactly that UserX is logged in ? Also is this a requirement that you need to use a browser ?

As I understand your UserX is accessing file on their Share Drive. Does the error occur also when he will save it locally and will try to access it locally ?

And since you are in Organization, have you tried to contact your IT , or you are IT administrator ?
Regards,
LA
***I'm an independent advisor and I don't work for Microsoft***

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your response, LA.

Yes, this occurs every time UserX is trying to view any pdf file and this is the issue from start, that till date we are not able to resolve this. 

UserX logs in our custom developed app and from there he can access his emails. We launch the Outlook using Process; the code of which is shared in previous post.

I am logged in in Windows system as myself or any other a/c, and in the app is logged as UserX trying to access his email through Outlook.

Reg Saving file :

  • UserX saves file in his Docs, Downloads, etc dir. It would be saved in C:\Users\Temp.VCSO.0001. When I or user try to open the Temp dir, I get error : "
  •       
  • If I try to save the file in C:\, then I get error :
  • The only path I found, where UserX can saves and access the file is C:\Users\Public dir and sub-dirs.

I am a Developer in IT Dept, and right now this issue is given to me to solve it. At this point, manager is looking for solution irrespective of giving permissions/rights to users to access their attachments. I can have the admin rights.

Thank You, 

Tom

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated July 9, 2024 Views 12,514 Applies to: