Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Visualizzare Internet Explorer con delle impostazioni che gli dò io

    salve a tutti,

    come si tradurrebbe il codice seguente, fatto in vba di outlook, in vb.net??

    codice:
    Option Explicit
    
    Const ENUM_CURRENT_SETTINGS As Long = -1&
    Const CCDEVICENAME = 32
    Const CCFORMNAME = 32
    Public Type DEVMODE
        dmDeviceName As String * CCDEVICENAME
        dmSpecVersion As Integer
        dmDriverVersion As Integer
        dmSize As Integer
        dmDriverExtra As Integer
        dmFields As Long
        dmOrientation As Integer
        dmPaperSize As Integer
        dmPaperLength As Integer
        dmPaperWidth As Integer
        dmScale As Integer
        dmCopies As Integer
        dmDefaultSource As Integer
        dmPrintQuality As Integer
        dmColor As Integer
        dmDuplex As Integer
        dmYResolution As Integer
        dmTTOption As Integer
        dmCollate As Integer
        dmFormName As String * CCFORMNAME
        dmUnusedPadding As Integer
        dmBitsPerPel As Integer
        dmPelsWidth As Long
        dmPelsHeight As Long
        dmDisplayFlags As Long
        dmDisplayFrequency As Long
    End Type
    Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean
    Sub ApriBrowser(ByVal strUrl As String, Optional blToolbar As Boolean = False)
        Dim Web As Object, Schermo As DEVMODE
        Call EnumDisplaySettings(0&, ENUM_CURRENT_SETTINGS, Schermo)
        Set Web = CreateObject("InternetExplorer.Application")
        With Web
            .Width = Schermo.dmPelsWidth * (90 / 100)
            .Height = Schermo.dmPelsHeight * (90 / 100)
            .Top = Schermo.dmPelsHeight * (5 / 100)
            .Left = Schermo.dmPelsWidth * (5 / 100)
            .Resizable = False
            .MenuBar = False
            .StatusBar = False
            .AddressBar = False
            .Toolbar = blToolbar
            .Visible = True
            .Navigate strUrl
        End With
        Set Web = Nothing
    End Sub
    ringrazio tutti anticipatamente
    Bombardare per la pace, è come trombare per la verginità.

    C'è qualcuno al mondo che tromba troppo secondo me...

    Andrea Medici

  2. #2
    risolto... grazie lo stesso...

    la sub è:

    codice:
        Public Sub ApriBrowser(ByVal strUrl As String, Optional ByVal blToolBar As Boolean = False)
            Dim Web As SHDocVw.InternetExplorerClass
            Dim Width As Integer, Height As Integer, Top As Integer, Left As Integer
            Web = New SHDocVw.InternetExplorerClass
            Width = Screen.PrimaryScreen.Bounds.Width * 0.9
            Height = Screen.PrimaryScreen.Bounds.Height * 0.9
            Left = Screen.PrimaryScreen.Bounds.Width * 0.05
            Top = Screen.PrimaryScreen.Bounds.Height * 0.05
            With Web
                .Width = Width
                .Height = Height
                .Left = Left
                .Top = Top
                .Resizable = False
                .MenuBar = False
                .StatusBar = False
                .AddressBar = False
                .ToolBar = blToolBar
                .Visible = True
                .Navigate(strUrl)
            End With
            Web = Nothing
        End Sub
    nei riferimento ho aggiunto il componente ShDocVw...
    Bombardare per la pace, è come trombare per la verginità.

    C'è qualcuno al mondo che tromba troppo secondo me...

    Andrea Medici

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.