11-16-2022
10:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-16-2022
10:59 AM
Thanks again...there was a bug in your code, so I tweaked a bit. Think there was a problem with Dialog box codde.
It runs now, but it even prompts me to update styles even when they are already up to date.
Anyway to get around that?
'This logic runs thru all of Drawings Styles and updates them. Sub Main() OpenDoc = ThisDoc.Document oStyles = OpenDoc.StylesManager.Styles ' Pop up message asking if you want to update styles oAns = MessageBox.Show("Update to Current Drawing Styles?", "Styles Update", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation, 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
Best,
Steve H.
Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Inventor Certified User / Vault Professional Influencer