『壹』 在網頁上打開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;