79162539

Date: 2024-11-06 12:18:28
Score: 0.5
Natty:
Report link

My solution to this problem:

Sub ExportSelectionToBMP()
    Dim vsoSelection As Visio.Selection
    Dim vsoPage As Visio.Page
    Dim exportPath As String
    Dim resolution As Double
  

    exportPath = "C:\Users\USERNAME\Desktop\11.bmp"
    resolution = 140
    
    Application.Settings.SetRasterExportResolution visRasterUseCustomResolution, resolution, resolution, visRasterPixelsPerInch
    
    
    
    Set vsoWindow = ActiveWindow
    Set vsoSelection = ActiveWindow.Selection
    

    If Not vsoSelection Is Nothing Then
        vsoSelection.Export (exportPath)
        MsgBox "Done.", vbInformation
          Else
        MsgBox "No selection", vbExclamation
    End If
End Sub
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Gregory A