<!--
function WebOpen()
{
obj = document.all.item("WebOffice");
if (obj !='')
{
//等待控件初始化完毕,时间长短可以根据网络速度设定。
setTimeout('openfile()',100);
}
}
function openfile()
{
switch(flag)
{
case '11':
frm.WebOffice.Open(strOpenUrl,true,"Word.Document","","");break;
case '12':
frm.WebOffice.Open(strOpenUrl,true,"Excel.Sheet","","");break;
case '13':
frm.WebOffice.Open(strOpenUrl,true,"PowerPoint.Show","","");break;
case '2':
frm.WebOffice.CreateNew("Excel.Sheet"); break;
case '3':
frm.WebOffice.CreateNew("PowerPoint.Show");break;
default:
frm.WebOffice.CreateNew("Word.Document"); }
}
function WebSave()
{
try
{
frm.WebOffice.Save(strURL);
}
catch(e)
{
}
return true;
}
function WebSaveLocal()
{
frm.WebOffice.showdialog(3);
}
function WebOpenLocal()
{
frm.WebOffice.showdialog(1);
}
function WebDocReload()
{
location.reload();
}
function WebOpenPicture()
{
frm.WebOffice.ActiveDocument.Application.Dialogs(163).Show();
}
function WebDocPrint()
{
frm.WebOffice.printout(true);
}
function WebDocPageSetup()
{
frm.WebOffice.showdialog(5);
}
function ShowRevision(boolvalue)
{
frm.WebOffice.ActiveDocument.ShowRevisions = boolvalue;
}
function WebAcceptAllRevisions()
{
frm.WebOffice.ActiveDocument.AcceptAllRevisions();
}
function WebSignature(str)
{
var doc = frm.WebOffice.ActiveDocument;
var strPic ='';
switch(str)
{
//此处可以是完整的URL
case '1':
strPic = strRoot + "/images/001.gif";
break;
case '2':
strPic = strRoot + "/images/002.gif";
break;
case '3':
strPic = strRoot + "/images/003.gif";
break;
}
//doc.Shapes.AddPicture(strPic, false, true,100,'','','',doc.Application.Selection.Range);
doc.Shapes.AddPicture(strPic, false, true,100);
}
function WebDocSignature()
{
try{
frm.WebOffice.WebSign();
var test;
var strFile = frm.WebOffice.WebSignTempFile;
frm.WebOffice.title=strFile;
var doc = frm.WebOffice.ActiveDocument;
doc.Shapes.AddPicture(frm.WebOffice.title, false, true,100,0,219,112,doc.Application.Selection.Range);
doc.Shapes(doc.Shapes.Count).Select();
var range = doc.Application.Selection.ShapeRange;
range.WrapFormat.Type = 3;
range.PictureFormat.TransparentBackground = true;
range.PictureFormat.TransparencyColor = 0xFFFFFF;
range.Fill.Visible = false;
frm.WebOffice.WebSignTempFileDel();
}
catch(E)
{
}
}
function WebTempFile(str)
{
var strValue='';
switch(str)
{
case '1':
strValue='OfficeCTRL技术开发中心发文';
break;
case '2':
strValue='OfficeCTRL技术开发中心公文';
var doc = frm.WebOffice.ActiveDocument;
doc.Shapes.AddPicture(strRoot + "/images/weboffice.jpg",false, true,0,-60);
break;
case '3':
strValue='OfficeCTRL技术开发中心公文';
break;
case '4':
strValue='OfficeCTRL技术开发中心收文';
break;
default:
strValue='电子政务文件';
}
//画线
var object=frm.WebOffice.ActiveDocument;
//var myl=object.Shapes.AddLine(100,60,305,60)
//myl.Line.ForeColor=255;
//myl.Line.Weight=2;
//var myl1=object.Shapes.AddLine(326,60,520,60)
//myl1.Line.ForeColor=255;
//myl1.Line.Weight=2;
//object.Shapes.AddLine(200,200,450,200).Line.ForeColor=6;
var myRange=frm.WebOffice.ActiveDocument.Range(0,0);
myRange.Select();
var mtext="★";
frm.WebOffice.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
var myRange=frm.WebOffice.ActiveDocument.Paragraphs(1).Range;
myRange.ParagraphFormat.LineSpacingRule =1.5;
myRange.font.ColorIndex=6;
myRange.ParagraphFormat.Alignment=1;
myRange=frm.WebOffice.ActiveDocument.Range(0,0);
myRange.Select();
mtext="[2003]154号";
frm.WebOffice.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
myRange=frm.WebOffice.ActiveDocument.Paragraphs(1).Range;
myRange.ParagraphFormat.LineSpacingRule =1.5;
myRange.ParagraphFormat.Alignment=1;
myRange.font.ColorIndex=1;
mtext=strValue;
frm.WebOffice.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
myRange=frm.WebOffice.ActiveDocument.Paragraphs(1).Range;
myRange.ParagraphFormat.LineSpacingRule =1.5;
//myRange.Select();
myRange.Font.ColorIndex=6;
myRange.Font.Name="仿宋_GB2312";
myRange.font.Bold=true;
myRange.Font.Size=28;
myRange.ParagraphFormat.Alignment=1;
//myRange=myRange=frm.WebOffice.ActiveDocument.Paragraphs(1).Range;
frm.WebOffice.ActiveDocument.PageSetup.LeftMargin=70;
frm.WebOffice.ActiveDocument.PageSetup.RightMargin=70;
frm.WebOffice.ActiveDocument.PageSetup.TopMargin=70;
frm.WebOffice.ActiveDocument.PageSetup.BottomMargin=70;
}
function WebSetWordTable()
{
var mText="",mTmp="",iColumns,iCells,iPost,iold=-1;
var myRange=frm.WebOffice.ActiveDocument.Range(0,0); //光标位置
frm.WebOffice.ActiveDocument.Tables.Add(myRange,10,10); //生成表格
//alert(mText);
for (var n=0; n<iColumns; n++)
{
for (var i=0; i<iCells; i++)
{
iPos = mText.indexOf(";",1+iold);
mTmp = mText.substring(iold+1,iPos);
frm.WebOffice.ActiveDocument.Tables(1).Columns(n+1).Cells(i+1).Range.Text=mTmp; //填充单元值
iold = iPos;
}
}
}
function WebGetWordContent()
{
try{
alert(frm.WebOffice.ActiveDocument.Content.Text);
}catch(e){}
}
function WebSetWordContent()
{
var mText=window.prompt("请输入内容:","测试内容");
if (mText==null){
return (false);
}
else
{
//下面为显示选中的文本
//alert(frm.WebOffice.ActiveDocument.Application.Selection.Range.Text);
//下面为在当前光标出插入文本
frm.WebOffice.ActiveDocument.Application.Selection.Range.InsertAfter (mText+"\n");
//下面为在第一段后插入文本
//frm.WebOffice.ActiveDocument.Application.ActiveDocument.Range(1).InsertAfter(mText);
}
}
function WebGetExcelContent()
{
frm.WebOffice.ActiveDocument.Application.Sheets(1).Select;
frm.WebOffice.ActiveDocument.Application.Range("C5").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "126";
frm.WebOffice.ActiveDocument.Application.Range("C6").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "446";
frm.WebOffice.ActiveDocument.Application.Range("C7").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "556";
frm.WebOffice.ActiveDocument.Application.Range("C5:C8").Select;
frm.WebOffice.ActiveDocument.Application.Range("C8").Activate;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)";
frm.WebOffice.ActiveDocument.Application.Range("D8").Select;
alert(frm.WebOffice.ActiveDocument.Application.Range("C8").Text);
}
//作用:保护工作表单元
function WebSheetsLock(){
frm.WebOffice.ActiveDocument.Application.Sheets(1).Select;
frm.WebOffice.ActiveDocument.Application.Range("A1").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "产品";
frm.WebOffice.ActiveDocument.Application.Range("B1").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "价格";
frm.WebOffice.ActiveDocument.Application.Range("C1").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "详细说明";
frm.WebOffice.ActiveDocument.Application.Range("D1").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "库存";
frm.WebOffice.ActiveDocument.Application.Range("A2").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "书签";
frm.WebOffice.ActiveDocument.Application.Range("A3").Select;
frm.WebOffice.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "毛笔";
frm.WebOffi
没有合适的资源?快使用搜索试试~ 我知道了~
C#在线编辑weboffice示例Demo
共26个文件
cs:5个
gif:5个
aspx:4个
4星 · 超过85%的资源 需积分: 50 59 下载量 44 浏览量
2016-11-15
13:56:27
上传
评论 1
收藏 1.23MB RAR 举报
温馨提示
可在线编辑office文件,签名,签章。
资源推荐
资源详情
资源评论
收起资源包目录
webofficecsharp.rar (26个子文件)
access
writefile.aspx 447B
weboffice.sln 1KB
weboffice.suo 15KB
uploadedit.aspx.cs 2KB
images
buy.gif 11KB
001.gif 3KB
login.gif 1KB
002.gif 4KB
weboffice.jpg 15KB
Thumbs.db 71KB
003.gif 4KB
weboffice-install.jpg 6KB
180.jpg 16KB
sec.jpg 176KB
webdocedit.aspx.cs 5KB
App_Code
dbsql.cs 2KB
webdocedit.aspx 8KB
writefile.aspx.cs 1KB
uploadedit.aspx 449B
Default.aspx.cs 677B
App_Data
weboffice.mdb 2.22MB
Default.aspx 3KB
ocx
Web.config 2KB
cssjs
weboffice.js 11KB
style.css 2KB
style.css 2KB
共 26 条
- 1
知足常乐小三
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页