cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kaneohe
Level 6

GenerateGUID Help

I've found several postings about how to generate a new Product Code from the automation interface. However, being extremely limited in my VB Script skills I haven't been able to figure out how to use this GenerateGUID method I've seen postings and documentation about. Here's about all I've come up with so far. As you can see I have a placeholder for where the GenerateGUID should be called but where does the resulting GUID actually go? Can someone fill in the blanks I've left in the code below?

Set oProject = CreateObject("ISWiAuto15.ISWiProject")
oProject.OpenProject = "C:\Path\To\Project.ism"
oProject.GenerateGUID()
oProject.ProductCode =
oProject.SaveProject
oProject.CloseProject
Set oProject = Nothing


Also, once I've gotten the script written do I just run the script as if it were any other executable and Windows will pick up on the .vbs extension and launch it appropriately?
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

GenerateGUID returns a GUID in string format. You can assign its return value to the project's ProductCode property:

oProject.ProductCode = oProject.GenerateGUID()


Note that there is some sample VBScript code in the ISWiProject help topic that demonstrates how to open a project.
0 Kudos
kaneohe
Level 6

Thanks for the response. I've been looking at the documentation on the rest of the code necessary to change the Product Code but all of the documentation made reference to "run GenerateGUID" but I had not seen anything that detailed how the function worked.
0 Kudos