Prozac Posted April 26, 2007 Share Posted April 26, 2007 (edited) Hi, I hope some one can show me how this vba code will look like in au3. CODESet objPropertyReader = CreateObject("DSOleFile.PropertyReader") Set objDocument = objPropertyReader.GetDocumentProperties _ ("C:\Scripts\Test.doc") Set colCustomProperties = objdocument.CustomProperties For Each strProperty in colCustomProperties If strProperty.Name = "TestProperty" Then strProperty.Value = "New value" End If Next Im trying to find out how to use dsofile.dll COM Object inside a AU3 script. But COM is not my strong side.. Actually I have never used it Regards Martin Edited April 26, 2007 by Prozac Link to comment Share on other sites More sharing options...
Zedna Posted April 26, 2007 Share Posted April 26, 2007 $objPropertyReader = CreateObject("DSOleFile.PropertyReader") $objDocument = $objPropertyReader.GetDocumentProperties("C:\Scripts\Test.doc") $colCustomProperties = $objdocument.CustomProperties For $strProperty in $colCustomProperties If $strProperty.Name = "TestProperty" Then $strProperty.Value = "New value" EndIf Next Very similar, isn't? Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
lordofthestrings Posted April 27, 2007 Share Posted April 27, 2007 just the createobject should be objcreate the rules for conversion are soooo simple... 1) variables in vb-code dont get a dollar, autoIT variables ALLWAYS get dollars (thats easier) 2) functions like createobject, getobject, are written differently, refer to help files for the correct name 3) vb code uses different comments, in vbscript a single quote is a comment, a double quote is a string.. autoIT doesnt care, both are strings,.. well thats about it.. for the rest I suggest you use the color coding to help you spot mistakes in your code.. Link to comment Share on other sites More sharing options...
Prozac Posted April 27, 2007 Author Share Posted April 27, 2007 Thanks a lot for the help. It really got me helped Regards Martin Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now