修改ppt另存为网页的mht文件内容,更改其显示方式

       今天有一个同事问我,一个ppt文件另存为网页的mht文件怎么来更改它,使它打开的时候不显示左侧的大纲。要是能把大纲那个按钮去掉,就更好了。于是就进行了一番探究。首先用文本编辑器打开Mht文件,发现里面的代码多是html代码和一些其他的编码组成。于是就满口答应同事,说是保证能改。等我忙完了手头的活就帮他你弄。

      等忙完了手头的活,开始着手解决这个问题。用浏览器打开这个文件,然后用 microsoft script debugger 设置断点进行调试。经过10多分钟的跟踪和测试。终于发现了解决问题的方法和途径。在ppt另存为mht文件的代码中。有如下的代码:

------=_NextPart_01C66948.2D444B10
Content-Location: file:///C:/6D3D4E51/030529211.files/frame.htm
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"
此代码段下面的内容就是这个网页的框架及页面。于是就把左侧的那个frame隐藏掉。
把如下代码中的

 <frameset cols=3D" 25%,*" onload=3D"Load()" id=3DPPTHorizAdjust framespacin=
g=3D1 frameborder=3D1>

改为:
<frameset cols=3D" 0%,*" onload=3D"Load()" id=3DPPTHorizAdjust framespacin=
g=3D1 frameborder=3D1>
< frameset  rows =3D"*,25"  border =3D0 >
 
< frameset  cols =3D"25%,*"  onload =3D"Load()"  id =3DPPTHorizAdjust  framespacin =
g=3D1 
frameborder =3D1 >
  
< frame  src =3Doutline.htm  title =3D"大纲"  name =3DPPTOtl >
  
< frame  src =3Dslide0002.htm  title =3D"幻灯片"  name =3DPPTS=
ld >
 
</ frameset >
 
< frameset  cols =3D"25%,*"  framespacing =3D1 >
  
< frame  src =3Doutline.htm  title =3D"大纲导航栏=
;" name =3DPPTOtlNav  scrolling =3Dno  noresize >
  
< frame  src =3Doutline.htm  title =3D"幻灯片导航=
;栏" name =3DPPTNav  scrolling =3Dno  noresize >
 
</ frameset >
</ frameset >
</ html >
ok!达到了隐藏左侧大纲显示的效果。但是点几下大纲按钮,又显示出来了。看来还得继续,把大纲按钮也隐藏掉!
这个也比较简单了,跟踪几下,就找到了地方。
在mht文件中有如下代码:
Content-Location: file:///C:/6D3D4E51/030529211.files/outline.htm
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"
此代码下面有这个一个函数:
function  LoadNav( oId,UpdFunc )
{
    document.ondragstart=3DCancelDrag
    document.onselectstart=3DCancelDrag
    document.body.style.margin=3D2
    UpdFunc()
    obj=3Ddocument.all.item(oId)
    obj.style.display=3D"block"
    obj.style.visibility= 3D"visible"
    document.bgColor=3D"threedface"

    if( parent.frames["PPTNts"] )
        notesBtn.style.display =3D ""
    if( parent.gHasNarration )
        nb_voiceBorder.style.display =3D ""
}
把其中红色的 visible改为hidden 即可。测试。正如要求的效果。ok。完工。

你可能感兴趣的:(ppt)