Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have 3 sheets, I want to create a macro that will assign all objects with the same Alternate State.
I have lots of objects on each sheet, so I want to save time
Tab1 = All Objects need assigned Alternate State Alt1
Tab2 = All Objects need assigned Alternate State Alt2
Tab3 = All Objects need assigned Alternate State Alt3
Is it possible, it would be a huge time saver
Thanks
Regards
Alan
AFAIK no - Re: Create state with an action.
- Marcus
Hi Marcus,
I have got as far as being able to display the Alternate State in a message
the below code loops through the sheets and displays the Alternate State for each object on each sheet, now I just need to assign a value, I have tried a number of things, but still cannot get it to work
SUB AlternateStates()
ON ERROR RESUME NEXT
FOR i = 0 TO ActiveDocument.NoOfSheets - 1
SET vSheet = ActiveDocument.GetSheet(i)
msgbox vSheet
Objects = vSheet.GetSheetObjects
FOR j = lBound(Objects) To uBound(Objects)
SET vObject = Objects(j)
SET vObjectField = vObject.GetField
msgbox (j & " has an Alternate State of " & vObjectField.GetStateName)
NEXT
NEXT
END SUB
Apologies, first msgbox should be i, no vSheet
Not your specific question, but can you you assign the SHEET to an alternate state and used <inherited> for the objects?
-Rob
Wow, how simple is that.......
I feel like an idiot, much easier solution Rob