????? ??????? ???? ?????? WebBrowser ?? Visual Basic ??? ??? ????? Office

?????? ????????? ?????? ?????????
???? ???????: 304643 - ??? ???????? ???? ????? ????? ??? ???????.
?????? ??? ????? Microsoft Visual C# 2005 ? Microsoft Visual C# .NET ?? ??? ???????? ???? 304662.
????? ???? | ?? ????

?? ??? ??????

??????

?? ???? ?? ??? ?? ????? ????? Microsoft Office ??????? ?? ????? Microsoft Visual Basic. ?? ???? Microsoft Visual Basic 2005 ? Visual Basic .NET ???? ???? OLE ???? ???? ?? ????? ????? Office ?? ?????. ??? ??? ???? ?? ????? ????? ????? ???? ????? ????? ActiveX ?? ???? ???? ????? Visual Basic ?? ?????? ?? ??????? ???? ?????? WebBrowser.

???? ??? ??????? ????? ??????? ??? ????? Office ????? ???? ?? ????? Visual Basic ???????? ???? ?????? WebBrowser.

??????? ????

????????? ActiveX ?? ?????? OLE embeddable ?????? ???? ??? ????? ???? ActiveX ?? ?????? OLE ?????????. ???? ???? ???? ??????? ? ?? ??? ????? ????? ActiveX ?? ???? ?????? ??????? ?? ????? ????. ????? ?? ???? ??? ????? ?? ??? ????? ????? ??? ??? ??? (??? ?? Microsoft Internet Explorer) ?? ???? ?? ????? ?? ???? ???? ?? ????????? ?????? (??? ??? Microsoft Office Binder). ????? ActiveX ????????? ?? ???? ?????? WebBrowser ??? ?????; ????? ???? ????????? ?????? OLE ??????? ???? ?? ??????? ??????? ?? ??? ??????.

????? ????????? Microsoft Visual Basic .NET ? Visual Basic 2005 ?? ???? ?????? ??????? ActiveX ?????? ????? ??????? ???? ?????? WebBrowser ???? ?????. ???? ?????? WebBrowser (Shdocvw.dll) ?? ??? ?? Internet Explorer ?? ???? ??????? ??? ??? ??????? Internet Explorer ?????? ?????.

????? ????? Visual Basic ??? ???????

?????? ????? Visual Basic ???? ???? Office ?????????? ???? ??????? ???????:
  1. ?? Microsoft Visual Studio 2005 ?? ?? Microsoft Visual Studio .NET ????? ????? ????? Windows ???????? 2005 Visual Basic ?? Visual Basic .NET. ??? ????? Form1 ???? ???????.
  2. ?? ??????? ?????? ???? ??? ????? ???? ??????? ???? ???? ?????? ????? ???? ???????. ??? ????? ??????? ?????? COM ????? ???? ??? WebBrowser Microsoft. ???? ??? ????? ?????? ???? ?????? WebBrowser ??? ???? ??????? ????? Windows. ???? ???? ?????? WebBrowser ?? ???? Explorer ?? ???? ???????.

    ?????? ?? Visual Studio 2005 ? ?? ??? ???? ??? ?????? 2.
  3. ???????? "???? ???????" ? ?? ?????? ???? ???? WebBrowser ? ???? ???? OpenFileDialog ???? ???? ?? ??? Form1. ???? ??? ?????? ????? ????? AxWebBrowser1 ? ????? ????? OpenFileDialog1 ????? ????? Button1 ??? ??? Form1.
  4. ????? ??? ??? ?? ??? Form1 ??? ???.
    Dim oDocument as Object
  5. ?? ???? ???????? ???????? ??????? ?? class. Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
       ByVal e As System.EventArgs) Handles Button1.Click
    
        Dim strFileName As String
    
        'Find the Office document.
        With OpenFileDialog1
            .FileName = ""
            .ShowDialog()
            strFileName = .FileName
        End With
    
        'If the user does not cancel, open the document.
        If strFileName.Length Then
            oDocument = Nothing
            AxWebBrowser1.Navigate(strFileName)
        End If
    
    End Sub
    
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As _
       System.EventArgs) Handles MyBase.Load
    
        Button1.Text = "Browse"
    
        With OpenFileDialog1
            .Filter = "Office Documents " & _
            "(*.doc, *.xls, *.ppt)|*.doc;*.xls;*.ppt"
            .FilterIndex = 1
        End With
    
    End Sub
    
    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As _
       System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    
        oDocument = Nothing
    
    End Sub
    
    Private Sub AxWebBrowser1_NavigateComplete2(ByVal sender As Object, _
       ByVal e As AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event) _
       Handles AxWebBrowser1.NavigateComplete2
    
        On Error Resume Next
    
        oDocument = e.pDisp.Document
    
        'Note: You can use the reference to the document object to
        '      automate the document server.
        MsgBox("File opened by: " & oDocument.Application.Name)
    
    End Sub
    					
    ?????? ??? ??? ????? ????????? ???????? ?? Visual Studio 2005. ???? ???????? ???? Visual Basic ????? ???? ??? ??????? ??? ????? ?????? ????? ????? Windows. ????? ??????? Form1. ??? ????? ??????? ???? ???? ??????? Form1.vb ? Form1.designer.vb. ????? ????????? ???????? ?? Form1.vb. ??? ????? Form1.designer.vb ??? ???? & ???? ????? Windows ????????? ???????? ???? ???? ?????? ???? ????????? ?????? ?????? ??? ?????? ????? ?????? ?? ???? ???????.
  6. ???? F5 ?????? ???????. ??? ????? ??? "???????" ? ???? ???? ?????? ??? ??? ???? ?? ????????? ????? ?? ??? Word ?? Excel ?? PowerPoint. ??? ?? ??? ?? ???? ??? ???. ??? ??? ??????? ???? ???? ?????? WebBrowser ? ???? ????? ???? ???? ??? Office ???? ?????? ???????.

???????? ??? ??????? ???? ?????? WebBrowser

??? ?????? ?? ??? ??? ??????? ???? ?????? WebBrowser:
  • ?????? ???? ?????? WebBrowser ????????? ???? ??? ??????. ??? ??????? WebBrowser1.Navigate ????? ????????? ???? ?????? ????? ?? Visual Basic ??????? ??? ??????? ?? ?????? ???? ????. ??? ??? ???? ???? ??????? ??????? ????? ??? ??????? ????? NavigateComplete2 ?? ??? ?????? ????? ????? ????? ???????. ??????? ????? ??????? ???? WebBrowser ???? ?? ?????? ?? ?????? ??? ???? ??? ?????? ??????? ?????? ???? ?? ????????? ???????? ?????? ??? ?????? ??? oDocument.
  • ?? ???? ???? ?????? WebBrowser ??? ???????.
  • ????? ???? ?????? WebBrowser ???? ??? ??? ????? ????? ???? ??? ??? ????? Office. ???? ??????? "???????" ????? ???? ????? ???? ???????? ??????? ?????? ???????.
    With oDocument.Application.CommandBars("Standard")
       .Position = 4 '[msoBarFloating]
       .Visible = True
    End With
    					
    ???? ??????? Internet Explorer (5.0 ?????????? ??????) ???? ?? ????? ??? ????? ????? ???? ???????? ????????? ???????? ???????.
    ' This is a toggle option, so call it once to show the 
    ' toolbars and once to hide them. This works with Internet Explorer 5
    ' but often fails to work properly with earlier versions...
    AxWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)
    					
  • ???? ?????? ?? ???????? ???????? ?? ???? ???? ?? ???? ???? WebBrowser ?? ????? ????? ?? ???? ???? ????? ?? ??? ??? ????? Office (??? ???? ??????? Word ?? ???? ????? ?????? Excel). ?? ???????? ?? ???? ??? ?????? ???? ???? ???? ??? ????? ?? ?????? ??? ????? ???? ?? ?? ???.

    ???? ??????? ?????? ?????? ?? Office ????? ???????, ???? ?????. ??? ??? ???? WebBrowser ????? ?? ??? ??????? ?? ????? ??? ??????? ?? Word ????????? ? ???? ??? ????? ??????? ???????? ??? ???????? ???????, ?????? ????? ??? ?? ????? ??????? ???? ????? ???? ????. ?????? ????? ??? ???? ????????.
  • ???? WebBrowser ???????? ?????? ?? ????? Click ??? ??? ??? (?? ?? ??? ?????? ?????? ??????? ?? ????????? ???????? ?????? ??) ? ?????? ??? ???? ????? ????????? ???????? ????????? ???????? ???????:
       AxWebBrowser1.Navigate("about:blank")
    					

???????? ??? ??????? ???? ?????? WebBrowser ?? ????? Microsoft Office 2007

???? ???????? ????? 2007 Office ?? ??? ???? ??????? Office ?? ?????? ???. ???? ??? ?????? ????? ??? ???? ?????? WebBrowser. ???? ???????? ????? ????? ActiveX ???? ????? ?? ???? ?????? WebBrowser ??? ????? ????????? ??? ??????? Office 2007. ????? ?? ????????? ??? ?????? ??????? ActiveX ???? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
311765???? ???? ActiveX C++ ??????? ???????? ??????? ?? Visual Basic ?? HTML
???????? ???????? ???? ????? ???????? ?? ????????? ??????? ?? ???? ?????? WebBrowser ? ????? ????? ??????? ?????? Internet Explorer. ????? ??????? ??? ??????? ??? ????? Internet Explorer ???? ??????? 2007 Office ?? ?????? ???. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
927009??? ??? ???? ???? ??? ?????? ??? ????? ?????? Microsoft Office 2007 ?? Windows Internet Explorer 7
?????? ??? ??? ?????? ??????? ???????? ??????? ?????? ???? ?? ????? ????? ??????? ??? 927009 ???? ????????? ??? ???? ?????? WebBrowser ???? ???????? ?? ???????. ???? ????????? ??? ???? ?????? Internet Explorer. ???????? ??? ???? ?? ?? ???? ??? ??????? ?? ????????? ?????????? ?? ??????? Microsoft Office. ?????? ???? ???????? ??? ??????? ??? ?? ??? ??????? ?? ??????? ??????.

?????

?????? ??? ???? ?? ????????? ??? ????? ??????? ???? ?????? WebBrowser ???? ??? ????? ???????? ??????? ?????? ?? "????? ??????? ?? Microsoft:
304562?? ???? Visual Studio 2005 ? Visual Studio .NET ???? ???? ????? OLE ?????? ??????? Windows
243058????? ??????? ???? ?????? WebBrowser ??? ????? Office
162719????? ??????? ???? ?????? WebBrowser ?? Visual Basic 5.0
202476BUG: ????? ????? ????? Word ?? ???? ?????? OLE "??" WebBrowser
188271????? ????? ??????? ???? ?????? WebBrowser ?? VB
191692?? ??? ????? Shdocvw.dll ?? ???? ??????? PDW
238313?????? ??? ???? ???? ????? ?????? ?????? ?? Visual Basic
927009??? ??? ???? ???? ??? ?????? ??? ????? ?????? Microsoft Office 2007 ?? Windows Internet Explorer 7

???????

???? ???????: 304643 - ????? ??? ??????: 04/?????/1428 - ??????: 8.1
????? ???
  • Microsoft Visual Basic 2005
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Office PowerPoint 2003
  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft PowerPoint 2000 Standard Edition
  • Microsoft Office Word 2003
  • Microsoft Word 2002 Standard Edition
  • Microsoft Word 2000 Standard Edition
????? ??????: 
kbmt kbactivedocs kbautomation kbhowto kbwebbrowser KB304643 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????304643

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com