我无法从Excel宏(办公室xp)打开Word.如果我使用此代码,它将停止在线Set wdDoc = wordapp.Documents.Open(polozka.ShortPath)并且程序冻结.如果我使用Set wdDoc = GetObject(polozka.ShortPath)而不是这一行,程序在这里停止With wdDoc.Selection"对象不支持此属性..."错误
Dim wordapp As Word.Application
Dim wdDoc As Word.Document
Set fso = CreateObject("Scripting.FileSystemObject")
Set files = fso.GetFolder("C:\path").Files
Set wordapp = CreateObject("Word.Application")
For Each polozka In files
Set wdDoc = wordapp.Documents.Open(polozka.ShortPath)
wordapp.Visible = True
With wdDoc.Selection
.HomeKey Unit:=6
.Find.Text = "Název (typ):"
.Find.Wrap = wdFindContinue
...
End With
...
wordapp.Quit
Set wordapp = Nothing
Next
Run Code Online (Sandbox Code Playgroud) 任何人都可以请求我显示VBA代码的一部分,它会从这个示例在线HTML表中获得文本"hello"吗?第一个节点将通过他的ID(id ="something")找到.
...
<table id="something">
<tr>
<td><TABLE><TR><TD></TD></TR><TR><TD></TD></TR></TABLE></td><td></td>
</tr>
<tr>
<td></td><td></td><td>hello</td>
</tr>
...
Run Code Online (Sandbox Code Playgroud)
我认为它会是这样的child->sibling->child->sibling->sibling->child,但我不知道确切的方式.
EDIT
更新的代码标签是CAPITALS.所以,如果我使用getElemenetsById("something").getElemenetsByTagName('tr')它只收集两个tr标签,或四个(标签是更深的孩子)?
如果我使用这个SQL:
UPDATE formulare SET EV_id=59, EV_status=5 WHERE EV_id=57 AND ID_uziv=12;SELECT LAST_INSERT_ID();
Run Code Online (Sandbox Code Playgroud)
我会得到0最后一个插入ID.我正在使用PHP mysqli_insert_id,这里说:
The mysqli_insert_id() function returns the ID generated by a query
on a table with a column having the AUTO_INCREMENT attribute.
If the last query wasn't an INSERT or UPDATE statement
or if the modified table does not have a column with the AUTO_INCREMENT attribute,
this function will return zero.
Run Code Online (Sandbox Code Playgroud)
我的表formualre有auto increment列,所以我不知道问题是什么