how do I start a page setup macro when a new document load is

J

JuneTheSecond

If you have already a document in visio , next macro starts a page setup when
you add a new document. But if do not have any drawing on visio, you might
have to use DocumentCreate events in any other langage.

Option Explicit

Private WithEvents myApp As Visio.Application

Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
' MsgBox "Document_DocumentSaved"
Set myApp = Application
End Sub

Private Sub myApp_DocumentCreated(ByVal doc As IVDocument)
' MsgBox "Document_DocumentCreated"
On Error Resume Next
Application.DoCmd visCmdOptionsPageSetup
End Sub
 
Top