『壹』 在网页上打开word文档
1、打开Word文档,单击菜单栏中的“文件”→“打开”对话框;
2、在“文件名专”编辑框中手动输入网页地址属,并单击“打开”按钮;
3、Word2003开始连接Web服务器,用户可以在Word窗口中看到目标网页内容;
4、并且可以进行编辑、复制、删除和保存等操作,如图所示;
5、选中需要复制的内容,并执行复制操作;
6、然后新建一个Word文档,将复制的内容粘贴到新的Word文档中,保存即可。
『贰』 asp.net 如何调用客户端word程序打开服务器上的word文档进行查看
做一个超连接,链接地址直接指向服务器上的word就可以了,这样客户端点击这个连接的时候会跳出一个窗口提示保存,打开。
『叁』 aspnet2005如何对word文档进行操作
你安装完vs2005 tool for office后,在新建项目就有word模板了。。
你就可以对word进行操作了。
补充:
首先引入类库,Microsoft.Office.Interop.Word,然后进行编程。代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Word;
namespace WordTest
{
public partial class Form1 : Form
{
object strFileName;
Object Nothing;
Microsoft.Office.Interop.Word.Application myWordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
Document myWordDoc;
string strContent = "";
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
createWord();
//openWord();
}
private void createWord()
{
strFileName = System.Windows.Forms.Application.StartupPath + "test.doc";
if (System.IO.File.Exists((string)strFileName))
System.IO.File.Delete((string)strFileName);
Object Nothing = System.Reflection.Missing.Value;
myWordDoc = myWordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
#region 将数据库中读取得数据写入到word文件中
strContent = "你好\n\n\r";
myWordDoc.Paragraphs.Last.Range.Text = strContent;
strContent = "这是测试程序";
myWordDoc.Paragraphs.Last.Range.Text = strContent;
#endregion
//将WordDoc文档对象的内容保存为DOC文档
myWordDoc.SaveAs(ref strFileName, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
//关闭WordDoc文档对象
myWordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
//关闭WordApp组件对象
myWordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
this.richTextBox1.Text = strFileName + "\r\n" + "创建成功";
}
private void openWord()
{
fontDialog1.ShowDialog();
System.Drawing.Font font = fontDialog1.Font;
object filepath = "D:\\asp.docx";
object oMissing = System.Reflection.Missing.Value;
myWordDoc = myWordApp.Documents.Open(ref filepath, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
myWordDoc.Content.Font.Size = font.Size;
myWordDoc.Content.Font.Name = font.Name;
myWordDoc.Save();
richTextBox1.Text = myWordDoc.Content.Text;
myWordDoc.Close(ref oMissing, ref oMissing, ref oMissing);
myWordApp.Quit(ref oMissing, ref oMissing, ref oMissing);
}
}
『肆』 ASP.NET 操作Word文档(读写),怎么实现
展示word文件这个网上不少例子。但是写入word制定位置就是操作word文档了。1.这个隐约记得是把word文档分成好几个区域实现操作,但这个不知道具体思路。
2,。如果客户允许,可是加个连接或按钮,“编辑文档”。转到文本编辑器里面。
http://www.haoxiai.net/wangzhanzuo/aspnet/53267.html
这里面多少有点原理。楼主看看
『伍』 急!如何在网页中直接打开word文档
Dreamwver不可以直接打开或编辑word文档,需要到相关web插件开发公司购买相关word控件的授权才行。如
NTKO
OFFICE(WORD)痕迹保留手写签名电子印章控件。
『陆』 如何在网上直接打开word文档,不用下载
在网上比如某个网站的附带的文件可以下载,如果是word格式,在点击下载后,有一个选项“直接打开”,点击即可直接网上阅读
『柒』 asp.net做的网页怎么能够直接打开远程的word和excel文件,并且支持在线编辑,并且能够在线保存
在aspx文件(前台文件)中写超链接,<a href="文件路径"/>,这样你的代码运行起来之后点击超链接会提示是否打开文件,点确定打开之后同样可以编辑并保存。当然这个需要你远程连接的机器授予权限。
不过需要注意几个问题.
1:你的文件如果是word,excel那么一定要确认访问的用户要装office.建议加上target='_block'.
2:你这样做极度危险,太不安全了。建议用vpn连接.
3:编码协议建议用https+ftp
『捌』 使用aspnet将word表单导入系统中形成web表单,在系统中完成web表单,然后将web表单再导出到word
web表单要有个东西来接收
用Grid
DataSetOpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "Excel files(*.xls)|*.xls";ExcelIO excelio = new ExcelIO();if(openFile.ShowDialog()==DialogResult.OK)
{
if(excelio!=null)
excelio.Close(); excelio = new ExcelIO(openFile.FileName);
object[,] range = excelio.GetRange();
excelio.Close();
DataSet ds = new DataSet("xlsRange"); int x = range.GetLength(0);
int y = range.GetLength(1); DataTable dt = new DataTable("xlsTable");
DataRow dr;
DataColumn dc;
ds.Tables.Add(dt); for(int c=1; c<=y; c++)
{
dc = new DataColumn();
dt.Columns.Add(dc);
}
object[] temp = new object[y];
for(int i=1; i<=x; i++)
{
dr = dt.NewRow(); for(int j=1; j<=y; j++)
{
temp[j-1] = range[i,j];
}
dr.ItemArray = temp;
ds.Tables[0].Rows.Add(dr);
} dataGrid1.SetDataBinding(ds,"xlsTable");
if(excelio!=null)
excelio.Close();
}
//导出
private void ExportToWord(DataTable dt, string targetWordFile)
{
object oMissing = System.Reflection.Missing.Value;
//Start Word and create a new document.
Word._Application oWord = null;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = false;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document.
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = dt.Rows[0]["mname"].ToString(); //会议名称!
oPara1.Range.Font.Bold = 1;
oPara1.Range.Font.Size = 18;
oPara1.Range.Font.Color = Word.WdColor.wdColorRed;
oWord.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;//水平居中
oPara1.Format.SpaceAfter = 24; //24 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter();
object oMissing2 = System.Reflection.Missing.Value;
//Insert a paragraph at the end of the document.
Word.Paragraph oPara2;
oPara2 = oDoc.Content.Paragraphs.Add(ref oMissing2);
oPara2.Range.Text = dt.Rows[0]["datetime"].ToString(); //会议时间
oPara2.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
oPara1.Range.Font.Color = Word.WdColor.wdColorBlack;
oPara2.Range.Font.Bold = 1;
oPara2.Range.Font.Size = 14;
oPara2.Format.SpaceAfter = 24;
oPara2.Range.InsertParagraphAfter();
int rowcount = dt.Rows.Count + 1; // 含标题行,及所有用户行 表格总行//Insert a 3 x 4 table, fill it with data, and make the first row
//bold and italic.
//Insert another paragraph.
Word.Paragraph oPara4;
oPara4 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara4.Format.SpaceAfter = 24;
oPara4.Range.Font.Bold = 0;
oPara4.Range.Font.Size = 12;
oPara4.Range.InsertParagraphAfter();
Word.Table oTable;
Word.Range wrdRng = oPara4.Range;