Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: steveh3

OK, I misunderstood.  I thought the one prompt you were talking about was the one at the end.  Here is a version with a question before the loop, asking if you want to proceed with updating all drawing styles.

 

'This logic runs thru all of Drawings Styles and updates them.
Sub Main()
	OpenDoc = ThisDoc.Document
	oStyles = OpenDoc.StylesManager.Styles
	oAns = MessageBox.Show("Do you want to update all Styles in this drawing?", _
	"Update Drawing Styles", MessageBoxButtons.YesNo, MessageBoxIcon.Question, _
	MessageBoxDefaultButton.Button2)
	If oAns = DialogResult.Yes Then
		'Runs thru all Styles and update them, if needed
		For Each oStyle As Style In oStyles
			If Not oStyle.UpToDate Then oStyle.UpdateFromGlobal
		Next
	End If
	Try : OpenDoc.Save : Catch : End Try
	'Tells user that Styles have been updated.
	MessageBox.Show("Drawing Styles have been Updated" & vbCr & oFile)
End Sub

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)