亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用 VBScript 從下拉列表中設置選項

如何使用 VBScript 從下拉列表中設置選項

搖曳的薔薇 2022-09-11 20:32:06
我的目標是超級簡單,我只想用.vbs填充一個網頁,我幾乎做了所有,只留下下拉列表我用了:Document.All.Item("CamposTrat[0]").Value = "FINALIZADO"但兩者都不起作用。Document.All.Item("CamposTrat[0]").SelectedIndex = 1幾乎工作了,它用藍色選擇“選項”最后定稿“(示例&html代碼),但沒有將”最后定稿“設置為屏幕上的”值“。感覺就像是缺少按“輸入”進行確認。.SelectedIndex = 1我只想把“最后”,而無需點擊或使用。我想要一個漂亮的代碼:D"SendKeys{"FINALIZADO"}"PS:我不太了解爪哇/虛擬腳本。我還不知道如何配置這些類型的代碼。如果有人可以發送“完整”代碼,那將很有幫助。
查看完整描述

2 回答

?
慕碼人2483693

TA貢獻1860條經驗 獲得超9個贊

3個月后,我到達了美麗的代碼kkk:


Dim sh

Dim WS

Dim IE

Dim Produto

Dim Index

Dim Motivo

Dim Obs


Set sh = CreateObject("Shell.Application")

Set WS = CreateObject("WScript.Shell")


For Each wnd In sh.Windows

   If InStr(1, wnd.FullName, "iexplore.exe", vbTextCompare) > 0 Then

      Set IE = wnd

      Exit For

   End If

Next


With IE.Document.All

   If .Item("CamposProtocolo[8].Descricao").Value = "Plano de voz" or .Item("CamposProtocolo[8].Descricao").Value = "Após Horário Atendimento" Then

      Produto = "MóVEL"

   Else

      Produto = .Item("CamposProtocolo[8].Descricao").Value

   End if


   If .Item("CamposProtocolo[7].Descricao").Value = "Cancelamento Total" or .Item("CamposProtocolo[7].Descricao").Value = "Cancelamento Parcial" Then

      Index  = 20

      Motivo = "OI CONTA TOTAL / OI TOTAL"

      Obs    = "Móvel e Oi Total cancelados - aguardando conclus?o da OS." & Chr(13) & "- Sem acesso a cancelamento/migra??o R2 -"

   Else

      Index  = 26

      Motivo = "STATUS SUSPENSO"

      Obs    = "Sem acesso a " & Chr(13) & "- Nenhuma altera??o realizada -"

   End if

End With


If MsgBox(" Finalizado? ", vbYesNo + vbQuestion, "Powered by Alexan") = vbYes Then

   With IE.Document.All

      .Item("CamposTrat[0]").SelectedIndex          = 1

      .Item("select2-28796-container").InnerText    = "FINALIZADO"

      .Item("CamposTrat[1]").SelectedIndex          = 23

      .Item("select2-28797-container").InnerText    = "SOLICITA??O ATENDIDA"

      .Item("CamposTrat[2]").Value                  = Produto

      .Item("CamposTrat[3]").Value                  = "BO RETEN??O EMPRESARIAL"

      .Item("CamposTrat[4]").Value                  = "CANCELADO"

      .Item("CamposTrat[5]").Value                  = .Item("CamposProtocolo[1].Descricao").Value

      .Item("CamposTrat[6]").Value                  = "0"

      .Item("CamposTrat[7]").Value                  = "0"

      .Item("CamposTrat[8]").Value                  = "-"

      .Item("CamposTrat[9]").Value                  = .Item("CamposProtocolo[14].Descricao").Value

      .Item("CamposTrat[10]").Value                 = "00.000.000/0000-00"

      .Item("CamposTrat[11]").Value                 = .Item("CamposProtocolo[1].Descricao").Value

      .Item("CamposTrat[12]").Value                 = "1"

      .Item("CamposTrat[13]").SelectedIndex         = 1

      .Item("select2-28809-container").InnerText    = "N?O"

      .Item("Status").SelectedIndex                 = 2

      .Item("select2-Status-container").InnerText   = "Finalizado"

      .Item("Observacao").Value                     = "Protocolo perfilado com sucesso!"

   End With


   IE.Visible = True

   WS.AppActivate "Tratar Protocolos - Internet Explorer"

   IE.Document.All.Item("Observacao").Focus

   WS.SendKeys "^{a}"


ElseIf MsgBox("  Pendente?   ", vbYesNo + vbQuestion, "Powered by Alexan") = vbYes Then

   With IE.Document.All

      .Item("CamposTrat[0]").SelectedIndex          = 4

      .Item("select2-28796-container").InnerText    = "PENDENTE"

      .Item("CamposTrat[1]").SelectedIndex          = Index

      .Item("select2-28797-container").InnerText    = Motivo

      .Item("CamposTrat[2]").Value                  = "FIXO + BL"

      .Item("CamposTrat[3]").Value                  = "BO RETEN??O EMPRESARIAL"

      .Item("CamposTrat[4]").Value                  = "DESMEMBRADO"

      .Item("CamposTrat[5]").Value                  = .Item("CamposProtocolo[1].Descricao").Value

      .Item("CamposTrat[6]").Value                  = "0"

      .Item("CamposTrat[7]").Value                  = "0"

      .Item("CamposTrat[8]").Value                  = "-"

      .Item("CamposTrat[9]").Value                  = .Item("CamposProtocolo[14].Descricao").Value

      .Item("CamposTrat[10]").Value                 = "00.000.000/0000-00"

      .Item("CamposTrat[11]").Value                 = .Item("CamposProtocolo[1].Descricao").Value

      .Item("CamposTrat[12]").Value                 = "0"

      .Item("CamposTrat[13]").SelectedIndex         = 1

      .Item("select2-28809-container").InnerText    = "N?O"

      .Item("Status").SelectedIndex                 = 4

      .Item("select2-Status-container").InnerText   = "Pendente"

      .Item("Observacao").Value                     = Obs

   End With


   WS.AppActivate "Tratar Protocolos - Internet Explorer"

   IE.Document.All.Item("Observacao").Focus

   WS.SendKeys "{UP}"

   WS.SendKeys "{END}"

End if


查看完整回答
反對 回復 2022-09-11
?
波斯汪

TA貢獻1811條經驗 獲得超4個贊

答案是:

IE.Document.All.Item("select2-37536-container").InnerText = "FINALIZADO"  
IE.Document.All.Item("CamposTrat[0]").SelectedIndex = 1


查看完整回答
反對 回復 2022-09-11
  • 2 回答
  • 0 關注
  • 355 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號