????? ??????? ???? ?????? WebBrowser ??? ????? Office

?????? ????????? ?????? ?????????
???? ???????: 243058 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

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

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

??????? ????

????? ????????? ActiveX ?????? OLE embeddable ?????? ???? ??? ????? ???? ActiveX ?? ?????? OLE ?????????. ???? ???? ???? ???? ? ?? ??? ????? ????????? ActiveX ?? ???? ?????? ??????? ?? ????? ????. ????? ?? ???? ??? ???????? ????? ????? ?? ???? ???? ??? ??? ??? ?????? ???? (??? Internet Explorer) ?? ??? ??? ??? ???? ???? ?? ????????? ?????? (??? ????? ?????).

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

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

???? ??????? ??????? ?????? ????? Visual Basic ??? ??????? Office:
  1. ?? ?????? Visual Basic ?? ????? ????? ????? ????. ??? ????? Form1 ???? ???????.
  2. ??? ?? ??????? ????????????? ???? ???? ?????? ????????. ?? ???? ?????? ?????? ????? ????? ??? Microsoft ?????? ?????? ?????? ? Microsoft ????? ??????. ???? ??? "?????" ????? ??????? ??? ???? ???????.
  3. ????? ???? ?? ???? ?????? WebBrowser CommonDialog ??????? CommandButton ??? Form1.
  4. ??? ???? ?? ?????? ????????? ???????? ??????? ??? ???? ????????? ???????? ?? Form1:
    Option Explicit
    
    Dim oDocument As Object
    
    Private Sub Command1_Click()
       Dim sFileName As String
       
     ' Find an Office file...
       With CommonDialog1
          .FileName = ""
          .ShowOpen
          sFileName = .FileName
       End With
       
     ' If the user didn't cancel, open the file...
       If Len(sFileName) Then
          Set oDocument = Nothing
          WebBrowser1.Navigate sFileName
       End If
    End Sub
    
    Private Sub Form_Load()
       Command1.Caption = "Browse"
       ' For the 2007 Microsoft Office documents, change the .Filter parameter of the 
       ' With CommonDialog1 statement to:
       ' .Filter = "Office Documents " & _
       '      "(*.docx, *.xlsx, *.pptx)|*.docx;*.xlsx;*.pptx"
       With CommonDialog1
          .Filter = "Office Documents " & _
          "(*.doc, *.xls, *.ppt)|*.doc;*.xls;*.ppt"
          .FilterIndex = 1
          .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly
       End With
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
       Set oDocument = Nothing
    End Sub
    
    Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, _
    URL As Variant)
       On Error Resume Next
       Set oDocument = pDisp.Document
    
       MsgBox "File opened by: " & oDocument.Application.Name
    End Sub
    					
  5. ???? F5 ?????? ???????. ??? ????? ???? "???????" ? ???? ???? ?????? ??? ???? ?? ?????? ??? ??? Word ?? Excel ?? PowerPoint. ???? ??? ??? ??? ? ??????? ???? ???? ?????? WebBrowser. ???? ???? ????? ?? ???? ??? ????? Office ???? ??? ?????.

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

??? ?? ????? ??????? ??? ??????? WebBrowser ?? ???? ??????:
  • ?????? ???? ?????? WebBrowser ???? ??? ?????? ??? ?????????. ???? ???? ?? ???????? ????? ?????? ??? ????? Visual Basic ??? ?? ??? ????? ???? ???????. ???? ??? ??? ??????? WebBrowser1.Navigate. ??? ??? ???? ???? ??????? ??????? ??????? ????? NavigateComplete2 ???? ????? ????? ????? ????? ???????. ??????? ????? ??????? ???? WebBrowser ?????? ??? ?????? ??? ???? ????? Office. ?? ????????? ???????? ??????? ??? ????? ?????? ??? oDocument.
  • ??? ?????? ???? ?????? ??? ???? ???? ?? ???? ???? WebBrowser ?? ????? ??? ??? ????? ?? ???? ???? ???? ??? ????? Office. ??? ????? ?? ???? ???? ??? ???? ??????? Word ?? ????? ?????? Excel ???? ". ?? ???????? ??????? ???? ???? ???? ??? ??? ??????? ?? ???????? ??? ????? ???? ?? ?? ???.
  • ???? ??????? ?????? ?? WebBrowser ??????? ????????? ???????? ??????? ???????? ??? ?????? ??????? ?????????? ???????? ?? ????? Click ??? ??? ???. ?? ?????? ???? ?? ??? ???????? ?????? ?? ????????? ????????.
       WebBrowser1.Navigate "about:blank"
    					

?? ??? ???????? ??? ??????? ???? ?????? WebBrowser ?? ????? Microsoft Office 2003 ??? ????????? ??????? ?? Office

??? ?? ????? ??????? ??? ??????? WebBrowser ?? ???? ??????:
  • ?????? ???? ?????? WebBrowser ????????? ???? ??? ??????. ???? ???? ??? ??? ??????? WebBrowser1.Navigate ???????? ?????? ?????? ??? ????? ?? Visual Basic ??????? ??? ?? ????? ??????? ???? ????. ??? ??? ???? ????? ??????? ??????? ????? ??? ??????? ????? NavigateComplete2 ????? ??? ????? ????? ???????. ??????? ????? ??????? ???? WebBrowser ?????? ??? ?????? ??? ???? ??? ???? ????? Office ???? ?? ????????? ???????? ?????? ??? ?????? ??? oDocument.
  • ?? ???? ???? ?????? WebBrowser ??? ???????. ??? ??? ?? ???? ??? ????? ??????? ??????? ???? ?? ??????? Visual Basic ??? ??????? ???? ???? ????? OLE ????? ?? ???.
  • ????? ???? ?????? 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...
       WebBrowser1.ExecWB OLECMDID_HIDETOOLBARS, OLECMDEXECOPT_DONTPROMPTUSER
    					
  • ???? ?????? ?? ???????? ???????? ?? ???? ???? ?? ???? ???? WebBrowser ?? ????? ? ?????? ?? ???? ???? ????? ?? ??? ??? ????? Office (??? ???? ??????? Word ?? ???? ????? ?????? Excel). ?? ???????? ?? ???? ??? ?????? ???? ???? ???? ??? ????? ?????? ??? ????? ???? ?? ?? ???.

    ???? ??????? ?????? ?????? ?? ????? ??????? Office ???? ???? ?????. ??? ??? ???? ????? ???? WebBrowser ?? ??? ??????? ?????? ????? ?? ??????? Word ?? ??? ???? ????? ??????? ???????? ??? ???????? ??????? "? ????? ?????? ????? ??? ?? ????? ??????? ????? ?????? ???? ????. ????? ???? ????? ??? ???? ????????.
  • ???? WebBrowser ???????? ?????? ?? ??? ????? ??? ??? ??? (?? ?? ??? ?????? ?????? ??????? ?? ????????? ???????? ?????? ??) ? ????? ??? ???? ????? ????????? ???????? ??? ???????? ????????:
       WebBrowser1.Navigate "about:blank"
    					

?????

????? ?? ????????? ??? ???? ?????? WebBrowser ?? Visual Basic "? ???? ??? ????? ???????? ??????? ?????? ??" ????? ??????? ?? Microsoft:
162719????? ??????? ???? ?????? WebBrowser ?? Visual Basic 5.0
188271????? ????? ??????? ???? ???? "?????? ???" ?? VB
191692?? ??? ????? Shdocvw.dll ?? ???? ??????? PDW
238313?????? ??? ???? ???? ????? ?????? ?????? ?? Visual Basic
927009??? ??? ???? ???? ??? ?????? ??? ????? ?????? Microsoft Office 2007 ?? Windows Internet Explorer 7

???????

???? ???????: 243058 - ????? ??? ??????: 08/?????/1428 - ??????: 6.2
????? ???
  • Microsoft Office Excel 2007
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft Office PowerPoint 2007
  • Microsoft Office PowerPoint 2003
  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft PowerPoint 2000 Standard Edition
  • Microsoft PowerPoint 97 Standard Edition
  • Microsoft Office Word 2007
  • Microsoft Office Word 2003
  • Microsoft Word 2002 Standard Edition
  • Microsoft Word 2000 Standard Edition
  • Microsoft Word 97 Standard Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic 5.0 Enterprise Edition
????? ??????: 
kbmt kbexpertiseinter kbhowto KB243058 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????243058

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

 

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