DsoFramer 微软的在线work控件有人用过吗?怎么定位到第几行第几列,急!附代码

bqwwin 2008-10-15 03:28:10
DsoFramer 微软的在线work控件有人用过吗?我现在想在网页加载时自动往之前做好的word模板里加一些字,但是现在不知道怎么定位到第几行第几列,哪位高手知道指点一下,附代码:

<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.Map"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<title>documentEdit</title>
<%
String basePath = request.getScheme()+"://"+request.getServerName()+"/";
System.out.println("basePath========="+basePath);
basePath = "http://www.ht.zjdtp.com/";
String filePath = basePath+"content/dav"+request.getSession().getAttribute("documentPath").toString();
System.out.println("filePath========="+filePath);

String con_code = "合同编码";
String con_name = "合同名称";
%>
<script language="VBScript">
Dim bDocOpen

Sub oframe_OnDocumentOpened(str, obj)
Dim s, s2
On Error Resume Next
bDocOpen = True

if len(str) = 0 then
str = "New Document"
else
Dim x
x = InStr(str, "\")
if x then
do
str = mid(str, x+1)
x = Instr(str, "\")
loop while x > 0
else
x = Instr(str, "/")
if x Then
do
str = mid(str, x+1)
x = Instr(str, "/")
loop while x > 0
end if
end if
end if

s = obj.Application.Name
End Sub

Sub oframe_OnDocumentClosed()
bDocOpen = False

End Sub


Sub OpenWebDoc(sUrl)
On Error Resume Next
If Len(sUrl) Then
document.all.oframe.Titlebar =false
document.all.oframe.open sUrl
document.oframe.EnableFileCommand(0)= FALSE
document.oframe.EnableFileCommand(1)= FALSE
document.oframe.EnableFileCommand(2)= True
document.oframe.EnableFileCommand(3)= True
if err.number then
MsgBox "无法打开文件 " & err.description
end if
End If
End Sub

Sub SaveWebDoc(sUrl)
On Error Resume Next
If Not bDocOpen Then
MsgBox "没有打开的文档."
Else
document.oframe.ActiveDocument.SaveAs sURL
MsgBox "操作成功"
End If
End Sub

Sub AcceptRevisions(pUrl)
if window.confirm("你确定要清稿吗?") then
On Error Resume Next
document.oframe.ActiveDocument.AcceptAllRevisions
document.oframe.WordBasic.AcceptChangesSelected
document.oframe.WordBasic.AcceptAllChangesInDoc
end if
End Sub

Sub unProtectDoc(pUrl)
MsgBox "取消保护状态"
document.oframe.ActiveDocument.Unprotect "xz"
End Sub

Sub InsertPic(imgUrl)
document.oframe.ActiveDocument.Shapes.AddPicture imgUrl,false,true,0,0,100,100,document.oframe.ActiveDocument.Application.Selection.Range
document.oframe.ActiveDocument.Shapes(1).ZOrder 4
End Sub

Sub ProtectDoc(pUrl)
MsgBox "保护状态"
document.oframe.ActiveDocument.Protect 1, True, "xz"
End Sub

Sub SaveChangeDoc(pUrl)
MsgBox "修订状态"
document.oframe.ActiveDocument.Protect 0, True, "xz"
End Sub


Sub ShowChangeDoc(pUrl)
document.oframe.ActiveDocument.ShowRevisions true
document.oframe.ActiveDocument.SaveAs pURL
End Sub



Sub PrintDoc()
On Error Resume Next
If Not bDocOpen Then
MsgBox "没有打开的文档."
Else
document.oframe.printout True
End If
End Sub

Sub CloseDoc()
On Error Resume Next
If Not bDocOpen Then
MsgBox "没有打开的文档."
Else
document.oframe.close
End If
End Sub

Sub Test_OnClick
Set doc = document.oframe.ActiveDocument
Set rngRange = doc.Range(0, 1)
//rngRange.InsertAfter " This is now the last sentence in paragraph one."
rngRange.InsertAfter "<%=con_code%>"
rngRange.InsertAfter "<%=con_name%>"


//Set paraCount = doc.Count

//MessageDlg(IntToStr(paraCount), mtInformation, [mbOK], 0)

//doc.Item(3).Range.InsertAfter("asdfaf")


End Sub
</script>
</head>
<body style="margin:0.0pt;" onload="OpenWebDoc('<%=filePath%>')">
<form name="docOnlineForm" method="post" action="UploadFile.jsp" enctype="multipart/form-data">
<table id="docTab" width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td valign="top"></td>
<td valign="top" colspan="2" align="center">
<object classid="clsid:00460182-9E5E-11d5-B7C8-B8269041DD57" id="oframe" width="100%" height="650">
<param name="BorderStyle" value="1">
<param name="TitlebarColor" value="52479">
<param name="TitlebarTextColor" value="0">
<param name="Menubar" value="1">
</object>
</td>
</tr>
</table>
<input type="button" id="Test" value=" add " onclick="Test_OnClick();">
</form>
</body>

</html>
...全文
218 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
以梦为马 2008-10-19
  • 打赏
  • 举报
回复
up
simon0512 2008-10-18
  • 打赏
  • 举报
回复
帮顶
lupanlupan 2008-10-17
  • 打赏
  • 举报
回复
关注!
关注!
内容概要:本文系统研究了构网型变流器的正负序阻抗解耦特性及其在弱电网环境下的稳定性表现,重点依托Matlab/Simulink仿真平台,构建了详细的阻抗数学模型,设计了解耦控制策略,并采用小信号扫频法进行频域辨识与稳定性验证。研究深入探讨了构网型变流器与传统跟网型逆变器在正负序阻抗特性上的本质差异,结合虚拟同步发电机(VSG)等先进控制技术,分析其在抑制宽频带振荡、削弱锁相环动态耦合等方面的优越性。文中不仅提供了完整的仿真模型与MATLAB代码实现,还整合了光伏、风电、储能、微电网等多类新能源系统的阻抗建模与稳定性分析资源,形成了一套面向新型电力系统稳定性的综合性技术资料体系,具有较强的科研复现与工程参考价值。; 适合人群:面向具备电力电子、电力系统自动化、新能源并网等专业背景的研究生、高校教师及工程技术人员,特别适用于从事阻抗建模、小干扰稳定性分析、宽频振荡机理研究以及撰写高水平学术论文的科研工作者。; 使用场景及目标:①掌握构网型变流器正负序阻抗建模与扫频辨识的仿真方法;②深入理解VSG等构网型控制在弱电网中提升稳定性的内在机理;③复现顶刊论文中的阻抗分析流程与稳定性判据应用;④利用提供的成熟模型与代码加速科研进程,支撑课题研究与学术成果产出。; 阅读建议:建议结合文中提供的Simulink模型与MATLAB代码,按照“理论建模—仿真搭建—扫频激励—频响提取—Nyquist判据分析”的完整流程进行实践操作,重点关注扫频信号的注入方式、频率范围设置及阻抗曲线的物理意义解读,并参考博士论文复现案例深化对复杂动态耦合问题的理解。

81,111

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧