-1

VBA を使用して、ソース表示タブから「Catalog Manager/ Sales」と「EOL (product/component)」というテキストを取得する必要があります。

以下は、ビューのソース コードです。

<tr>
    <td nowrap="true" valign="top" width="165px" class="ms-formlabel"><h3 class="ms-standardheader"><a name="SPBookmark_Requesting_x0020_Group"></a>Requesting Group</h3></td>
    <td valign="top" class="ms-formbody" width="450px" id="SPFieldChoice">
        <!-- FieldName="Requesting Group"
             FieldInternalName="Requesting_x0020_Group"
             FieldType="SPFieldChoice"
          -->
        Catalog Managers/ Sales
    </td>
</tr>

<tr>
    <td nowrap="true" valign="top" width="165px" class="ms-formlabel"><h3 class="ms-standardheader"><a name="SPBookmark_Reason_x0020_for_x0020_change"></a>Reason for change</h3></td>
    <td valign="top" class="ms-formbody" width="450px" id="SPFieldChoice">
        <!-- FieldName="Reason for change"
             FieldInternalName="Reason_x0020_for_x0020_change"
             FieldType="SPFieldChoice"
          -->
        EOL (product/component)
    </td>
</tr>

複数id="SPFieldChoice"あり、「要求グループ」と「変更の理由」の詳細のみを取得する必要があります。

私はExcelで詳細を取得するために以下のコードを書いていますが、それは私の要件に固有のものではありません.

Set hcol = ie.document.getElementsByTagName("td")
    For Each inps In hcol
        If inps.ID = "SPFieldChoice" Then
            Sheets("Sheet2").Range("A" & j).Value = inps.innerText
        End If
    Next

上記の必要な詳細のみを取得できるコードが必要です。

4

1 に答える 1