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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top