我用Word OLE控制元件把Word檔案以image型別存到資料庫中 現在我想實作當存盤Word檔案到資料庫時同時提取出Word檔案中我想要的一部分內容 這個功能可以實作嘛??請各位高手幫幫小弟~!~!~!
uj5u.com熱心網友回復:
為什么沒有人啊 自己頂一下~!uj5u.com熱心網友回復:
不太明白你的意思,做書簽可以吧!uj5u.com熱心網友回復:
我也想過用書簽 可是怎么提取出來啊 那句話不會寫啊uj5u.com熱心網友回復:
1.書簽2.若是表格里的內容,則更容易通過表格定位實作
uj5u.com熱心網友回復:
幫頂一下.uj5u.com熱心網友回復:
通過表格定位實作PHP CODE$MyWord=new COM("Word.Application") or die("錯誤:無法啟動Word");
$MyWord->Visible=true;//顯示Word視窗
$MyWord->Documents->Add('\\'.$filename);//新建檔案
$table_rownum = $MyWord->Documents->item(1)->Tables->Item(1)->Rows->Count;
$table_colnum = $MyWord->Documents->item(1)->Tables->Item(1)->Columns->Count;
$MyWord->ActiveDocument->Tables->Item(1)->Cell(13,1)->Select;
$test= $MyWord->Selection->Text;
$MyWord->Quit();//關閉Word視窗
$MyWord=NULL;
return $test;
uj5u.com熱心網友回復:
通過VBA應該可以實作書簽的添加和查找,給一段VBA代碼供參考Sub Example()
Dim myBook As String
Dim myRange As Range
Dim i As Integer, oShape As Shape
myBook = "A"
Set myRange = ActiveDocument.Content
GN: With myRange.Find
.ClearFormatting
.Format = True
.Style = "管理標題"
Do While .Execute
i = i + 1
ActiveDocument.Bookmarks.Add Name:=myBook & i, Range:=myRange
myRange.SetRange myRange.End, ActiveDocument.Content.End
GoTo GN
Loop
End With
For Each oShape In ActiveDocument.Shapes
If oShape.Type = msoTextBox Then
Set myRange = oShape.TextFrame.TextRange
GNA: With myRange.Find
.ClearFormatting
.Format = True
.Style = "管理標題"
Do While .Execute
i = i + 1
ActiveDocument.Bookmarks.Add Name:=myBook & i, Range:=myRange
myRange.SetRange myRange.End, oShape.TextFrame.TextRange.End
GoTo GNA
Loop
End With
End If
Next
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/97916.html
標籤:控件與界面
上一篇:PB8.0中將PARADOX 檔案匯入到 MS SQL SERVER 2000 資料庫中
下一篇:pb中的popmenu的問題
