【问题标题】:copy specific text internet explorer to acces复制特定文本 Internet Explorer 以访问
【发布时间】:2017-02-16 07:43:09
【问题描述】:

我正在尝试在访问中使用 vba 从网页复制值/文本。这个值在 4 个不同的地方,每个地方都可以使用

这些地方的代码行是

document.title = document.title + ' - Verplaatsingsopdracht - Journaal: 4900446438,';</SCRIPT>

<caption  class="formcaption" ><nobr>Verplaatsingsopdracht - Journaal: 4900446438, </nobr></caption>

<td nowrap  class="forminput"  ><input type=text VALUE="4900446438" name="dsInventJournalTable_JournalId" style="border: 0" READONLY  MAXLENGTH="10"></td>

<td valign="top" class="information"><img src="resources/images/Info.gif" align="absmiddle">&nbsp;          Journaal 4900446438 is bevestigd</td></tr><tr><td>

我只对需要粘贴到名为 txtJrnnr 的表单文本字段中的期刊号感兴趣。当然期刊号每次都会改变,所以我无法搜索这个号码,我需要在 html 中复制创建这个号码的地方。 希望你能帮忙

【问题讨论】:

  • 您是否将 html 加载到字符串变量中?

标签: ms-access vba copy internet-explorer-11 ms-access-2007


【解决方案1】:

假设您正在将 HTML 读入一个变量,您可以使用 Split 函数来提取您想要的数据,因为它似乎始终是一致的

Dim strHTML     as String
Dim strData     as String
dim strJournal  as String

Dim varSplit    as Variant

Dim varJournal  as Variant

strHTML =  read from web object

' Split the HTML into segments using Journaal
varSplit = Split(strHTML, "Journaal: ")

' Get the second element
strData = varSplit(1)

' Strip and cleanup the Journal Number
varSplit = Split(strData, ",")

' Get the Journal Number
strJournal = varSplit(0)

【讨论】:

    猜你喜欢
    • 2019-06-17
    • 1970-01-01
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-27
    • 2012-10-17
    相关资源
    最近更新 更多