On 10/3/07, Tim Roberts <[EMAIL PROTECTED]> wrote:
>
> r c wrote:
> >
> > >In this case, where an indexed property had both a "Get" and a
> "Let"
> > >handler, the Python COM stuff generates a "Value" function for
> > the "Get"
> > >part, and a "SetValue" function for the "Let" part. >
> > >
> > >So, you want:
> > > objCOMAdminCatalogObject.SetValue("ID", AppID) >
> > >
> > >--
> > >Tim Roberts, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > > Providenza & Boekelheide, Inc.
> >
> > When I try SetValue I get:
> >
> >
> >
> > Traceback (most recent call last):
> >
> > _File
> >
> "C:\programming\python\dev\src\FullInstallScripts\COMObjectFullInstall.py",
> > line 74, in <module>_
> >
> > CreateApplication()
> >
> > _File
> >
> "C:\programming\python\dev\src\FullInstallScripts\COMObjectFullInstall.py",
> > line 21, in CreateApplication_
> >
> > objCOMAdminCatalogObject.SetValue("ID", AppID)
> >
> > _File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line
> > 496, in __getattr___
> >
> > raise AttributeError, "%s.%s" % (self._username_, attr)
> >
> > AttributeError: Add.SetValue
> >
>
> Not sure what to tell you. This exact script runs correctly for me:
>
> import win32com.client
>
> objCOMAdminCatalog =
> win32com.client.Dispatch("COMAdmin.COMAdminCatalog")
> objApplications = objCOMAdminCatalog.GetCollection ("Applications")
> objCOMAdminCatalogObject = objApplications.Add()
> AppID = objCOMAdminCatalogObject.Value("ID")
> print "ID", objCOMAdminCatalogObject.Value("ID") #This is returning
> the random ID
> objCOMAdminCatalogObject.SetValue("ID",AppID)
>
> Have you run "makepy" on this type lib?
>
> --
> Tim Roberts, [EMAIL PROTECTED]
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-win32
>
Perfect! Adding the makepy to my script allowed me to call the SetValue
method:
win32com.client.gencache.EnsureModule(pywintypes.IID(*
'{F618C513-DFB8-11D1-A2CF-00805FC79235}'*), 0x0, 1, 0)
Thank you
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32