Jump to content

Recommended Posts

Posted

Hello again, i have a code that changes username to favorite, my problem is how to use ObjEvent() function to catch errors, i've red Help File and Forum's Topics but i can't understand too much😐

Here is a code (I've copied this codes from a user of AutoIt Forum):
 

$sOldUser = "Administrator"
$sNewUser = "Admin"
$oUser = ObjGet("WinNT://" & @ComputerName & "/" & $sOldUser & ",user")
$oComputer = ObjGet("WinNT://" & @ComputerName)
$oNewUser = $oComputer.MoveHere($oUser.ADsPath, $sNewUser)

Thanks for your care, I'm new to AutoIt and days should be passed with my coding and practicing to don't bother you :)❤

Posted
Posted
  On 1/23/2020 at 6:08 PM, Danyfirex said:

Did you check help file. 🤔

Expand  

Hello @Danyfirex, yep!, as i told in topic's message, i've seen Help File but i didn't understand too much, i've red some topics and got some informations about handling errors but those examples were as a Functional Object (Func...EndFunc type) and i didn't understand.

Posted

First step is to read the section about objects in the help file.

Then have a look at the Excel or Word UDF that come with AutoIt.
Then have a look at the MSDN pages for the Excel or Word object model.

Then check some example scripts in the forum like this.

Happy reading :)

My UDFs and Tutorials:

  Reveal hidden contents

 

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
×
×
  • Create New...