Home > database >  Questions about the Word OLE control
Questions about the Word OLE control

Time:09-29

I use the Word OLE controls the Word document to image type deposit in the database now I want to achieve when stored Word document to the database at the same time to extract the Word document I want to be part of this function can be achieved?? Ask everybody to help the younger brother ~! ~! ~!

CodePudding user response:

Why did no one ah oneself the top ~!

CodePudding user response:

Don't quite understand what you mean, do bookmark can be!

CodePudding user response:

I also want to use bookmarks but how to extract the words can't write

CodePudding user response:

1. The bookmarks
2. If the content of the form, it is more easily achieved by positioning table

CodePudding user response:

For the top.

CodePudding user response:

By positioning table PHP CODE
$MyWord=new COM (" Word. Application ") or die (" error: unable to start the Word ");
$MyWord - & gt; The Visible=true;//show the Word window
$MyWord - & gt; The Documents - & gt; Add (' \ \ '. $filename);//new document
$table_rownum=$MyWord - & gt; The Documents - & gt; The item (1) - & gt; Tables - & gt; The Item (1) - & gt; Rows - & gt; The Count.
$table_colnum=$MyWord - & gt; The Documents - & gt; The item (1) - & gt; Tables - & gt; The Item (1) - & gt; The Columns - & gt; The Count.
$MyWord - & gt; ActiveDocument - & gt; Tables - & gt; The Item (1) - & gt; Cell (13, 1) - & gt; The Select;
$test=$MyWord - & gt; Selection - & gt; Text;
$MyWord - & gt; The Quit ();//close the Word window
$MyWord=NULL;
Return $test;

CodePudding user response:

By VBA should realize and find the bookmarks, to a VBA code for your reference
Sub Example ()
Dim myBook As String
Dim myRange As Range
Dim I As an Integer, oShape As Shape
MyBook="A"
The Set myRange=ActiveDocument. Content
Designed.the GN: With myRange. Find
. ClearFormatting
. The Format=True
. Style="management title"
The Do While. Execute
I=I + 1
ActiveDocument. Bookmarks. Add Name:=myBook & amp; I, the Range:=myRange
MyRange. SetRange myRange. End, ActiveDocument content. End
GoTo designed.the GN
Loop
End With
For Each oShape In ActiveDocument. Shapes
If oShape. Type=msoTextBox Then
The Set myRange=oShape. TextFrame. TextRange
GNA: With myRange. Find
. ClearFormatting
. The Format=True
. Style="management title"
The Do While. Execute
I=I + 1
ActiveDocument. Bookmarks. Add Name:=myBook & amp; I, the Range:=myRange
MyRange. SetRange myRange. End, oShape TextFrame. TextRange. End
GoTo GNA
Loop
End With
End the If
Next
End Sub

  • Related