Hello James,
Here's a quick snippet that just shows the fill dialog and assigns to the
selected shape:
Sub SetFormat()
Dim shp As Shape
Set shp = ActiveWindow.Selection.PrimaryItem
If Not shp Is Nothing Then
On Error GoTo ErrorHandler
Application.DoCmd (visCmdFormatFill)
End If
ErrorHandler:
Select Case Err.Number
Case -2032466955
'OK or Cancel button clicked with no changes
'made to dialog OR changes made to dialog
'but Cancel clicked - Result, no changes to be applied
'Debug.Print Err.Number
shpDupe.Delete
Exit Sub
Case 0, 20
'Errors occur on any OK or Cancel button click
'(Error 20 - Description "Resume without error")
'Debug.Print Err.Number, Err.Description, Err.Source
Resume Next
Case Else
Debug.Print Err.Number, Err.Description, Err.Source
Resume Next
End Select
End Sub
If you're wanting to apply the formating to another shape/s on a different
page then my suggestion is that you drop a temporary shape call the dialog
as above and then copy what formatting you're after from your temporary
shape to your target shape. That way you can handle the user cancelling the
operation or apply 'inappropriate' choices etc. Not a perfect solution but
it does work.
Best regards
John
John Goldsmith (Visio MVP)
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk