使用WebBrowser浏览Word或Visio文档,如何禁止其打开之前显示下载提示对话框,将文档直接打开浏览?
有没有API或修改注册表之类的办法?

解决方案 »

  1.   

    应该进行客户端的Script编程吧!!!
      

  2.   

    你必須安裝Word的組件.如Office
    就不會了.
      

  3.   

    不是的,这是微软浏览器的安全设置,防止不明程序被下载。而我用Webbrowser做Office文档的容器编辑文档,每次需要打开一个visio的模板文件,可Webbrowser都要有一个下载提示,不能直接打开,很不方便用户使用。怎么办??????????????????????????????
      

  4.   

    找到那个对话框(FindWindow),向它发送模拟的按键“打开”(Alt+...)
      

  5.   

    mountlin(为什么):办法不错!!!!能否说说怎么找到对话框,俺不懂!!
      

  6.   

    不行的.模擬打開後並不會給你把內容也顯示到網頁裡面.還有一種方法.
    找到doc和visio在微軟的CODEBASE.你在你的網頁裡面可以這樣寫
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=120 HEIGHT=50>
    這裡codebase就是你需要查找的.也可以通過局域網羅下載.
      

  7.   

    下面是局域網羅下載的例子
    <HTML>
    <HEAD>
    <TITLE>ORAL_EXAM.CAB</TITLE>
    </HEAD>
    <BODY>
    <OBJECT ID="ORAL"
    CLASSID="CLSID:FA7D12E4-69D9-41C1-B12C-0D5FC2E0417B"
    CODEBASE="ORAL_EXAM.CAB#version=1,0,0,0">
    </OBJECT>
    </BODY>
    </HTML>
      

  8.   

    楼上:
     我没搞懂你的意思,
     我是在单击版软件中,自己的窗口中集成编辑visio文档。
     怎么实现?
      

  9.   

    你可以在office安裝盤裡面找到關於處理Word的.cab文件(我不知道是哪個.也許是
    office1.cab.(接下來的處理我也不太清楚)..可能你要installshield到你的軟件裡面...關於cab的加載的其他方法,我並不知道.
      

  10.   

    不是安装word的问题。我说了,这是IE的安全设置。
    但我是用它做单机软件的OFFICE容器。打开WORD文档好办,让用户去掉那个check框即可,下次可直接打开了。
    而对于visio文件,那个check框根本不可用,看IE的帮助,说是安全设置。那我怎么办呢?谢谢各位,可老是以微软技术专家称呼的人呢?为何不给解答!!!请各位帮我UP
      

  11.   

    YP2002CN(老婆我不敢了,老婆我愛你) :如能解决,不胜感激,保证我几个帖子的几百分全送上。俺需要VB的函数。
      

  12.   

    vb的?我的是vc的...(這個是設置低安全級別的.一個同事寫得.)你試一試吧
    要vb的話..需要你自己改代碼了.掉用這個就可以了.至於恢復的程序段不在我這裡
    IESetLowSecurity()
    {
    IInternetSecurityManager* m_pSecurityMgr;
    IInternetZoneManager* m_pZoneMgr;
    HRESULT hr;
    hr = CoCreateInstance(CLSID_InternetSecurityManager, NULL, CLSCTX_INPROC_SERVER,
    IID_IInternetSecurityManager, (void**)&m_pSecurityMgr);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("Create InternetSecurityManager Failed!"));
    return ;
    }

    hr = CoCreateInstance(CLSID_InternetZoneManager, NULL, CLSCTX_INPROC_SERVER,
    IID_IInternetZoneManager, (void**)&m_pZoneMgr);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("Create InternetZoneManager Failed!"));
    return ;
    } //Get all security zone
    DWORD dwEnumZone=0,dwZoneCount=0,dwZoneIndex=0,dwCurrentZone=0;
    hr=m_pZoneMgr->CreateZoneEnumerator(&dwEnumZone,&dwZoneCount,0);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("CreateZoneEnumerator Failed!"));
    return ;
    } /*Zone Index:
    0----Local Machine zone
    1----Local intranet zone
    2----Trusted sites zone
    3----Internet zone
    4----Restricted sites zone
    */
    for (dwZoneIndex=0;dwZoneIndex<dwZoneCount;dwZoneIndex++)
    {
    //Get zone of specified enumerated zone index
    hr=m_pZoneMgr->GetZoneAt(dwEnumZone,dwZoneIndex,&dwCurrentZone);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("GetZoneAt Failed!"));
    return ;
    } //Get zone security policy of specified zone index
    DWORD dwPolicy=URLPOLICY_ALLOW;
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_ACTIVEX_RUN,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_DOWNLOAD_SIGNED_ACTIVEX,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_DOWNLOAD_UNSIGNED_ACTIVEX,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_SCRIPT_RUN,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    hr=m_pZoneMgr->SetZoneActionPolicy(dwCurrentZone,
    URLACTION_SCRIPT_SAFE_ACTIVEX,
    (BYTE *)&dwPolicy,
    sizeof(DWORD),
    URLZONEREG_DEFAULT);
    TRACE(_T("Error code=%d\n"),hr);
    if (hr!=S_OK)
    {
    AfxMessageBox(_T("SetZoneActionPolicy Failed!"));
    return ;
    }
    }}
      

  13.   

    谢谢,YP2002CN(老婆我不敢了,老婆我愛你) :您的程序只能更改安全设置,还不能解决我的问题:去掉哪个讨厌的询问框!!
    你用浏览器打开一个visio文档就会发现问题了。不过谢谢费心,稍后一定送分。
      

  14.   

    Every time you double-click to open an attachment in your email, Windows asks if you want to download or open it - like a JPG for example. Well what if you just want it to open that picture by default, no prompts?Windows 2000 - Double-click My Computer, select Folder Options... from the Tools menu. Click on the File Types tab. Click and highlight the file Extension out of the list, in this case JPG. Click the Advanced button, un-check the box for Confirm open after download. Click OK twice.Windows 9x - Double-click My Computer, select Folder Options... from the View menu. Click on the File Types tab. Click and highlight the file type out of the list, in this case JPEG Image. Click the Edit... button, un-check the box for Confirm open after download. Click OK twice.哥们儿,我不是跟你说了吗?
    改操作系统得文件夹选项就可以了,ie4之前可以设置注册表更改,之后我就不知道了。