Jump to content

Add attachment


 Share

Recommended Posts

This is my code and I get an error message:subscript used on non-accessible variable

Can someone help me? Thanks

  Local $sText=""
   Local $teller =0
   WinWaitActive("Open")
   Local $hWnd = ControlGetHandle("Open", "", 1148)
   ControlFocus("Open","",1148)
   Send($CmdLine[1])
   $sText = ControlGetText($hWnd, "", 1148)

    While Not StringCompare($sText,$CmdLine[1]) And $teller < 3
      WinWaitActive("Open")
      $hWnd = ControlGetHandle("Open", "", 1148)
      ControlFocus("Open","",1148)
      ControlSetText($hWnd,"",1148,"")
      Send($CmdLine[1])
      $sText = ControlGetText($hWnd, "", 1148)
      $teller = $teller + 1
   WEnd
   ControlClick("Open","",1)
   ;Send("{ENTER}")
   WinWaitClose("Open"[,""[,timeout=15])

 

Edited by JLogan3o13
Added code tags
Link to comment
Share on other sites

  • Moderators

@alexhuang welcome to the forum.

  • First and foremost, when posting please explain in detail what you are trying to accomplish - it is a lot better than asking us to guess.
  • Secondly, post the output of the SciTE window that shows the error, as it should also show you which line the error is on (again, better than having us guess).
  • Lastly, when posting code please use the code tags ( <> in your toolbar when posting), it makes it much easier to read. I have modified your original post so you can see what I mean.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

"Add attachment" means "adding an attachment to an email"?
If yes, which mail programm do we talk about?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

Ok, attacking someone brand new for not asking the question correctly is not something we want to start around here.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

The last line of your script

WinWaitClose("Open"[,""[,timeout=15])

is wrong. Brackets denote optional parameters.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Never mind. We all started as newbies on this forum :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...