KoMaDo   VISIO SQUARE : 雑談その他  ■ Headline ■ HOME    

雑談その他トップへ ▼カッ飛び最後 

  ステンシルや図面マスターのアイコン一覧を作るマクロ

01: 名前:yoda投稿日:2006/09/26(火) 09:58
英文の掲示板で、Visio図面のステンシルや図面マスターに
あるマスターのアイコンを印刷したいという話題があったので、
アイコンを、図面の上に並べてコピーするマクロを作ってみました。
ただし、ただ並べているだけですので、数が多いと図面からはみ
出しますし、重複しているものもあると思います。
Sub test()
Dim mydoc As Visio.Document
Dim mst As Visio.Master
Dim myFolder As String
Dim myshp As Visio.Shape
Dim I As Integer
Dim myPageHeight As Double

myPageHeight = ActivePage.PageSheet.Cells("PageHeight")
myFolder = "C:\Documents and Settings\yoda\My Documents\Visio図面\MatserIcons\"
For Each mydoc In Application.Documents
For Each mst In mydoc.Masters
I = I + 1
stdole.SavePicture mst.Icon, myFolder & "myIcon.gif"
Set myshp = ActivePage.Import(myFolder & "myIcon.gif")
myshp.Cells("PinY").FormulaU = myPageHeight - 0.5 * I
myshp.Text = mst.Name
myshp.Cells("Para.HorzAlign") = 0
myshp.Cells("TxtWidth").Formula = "Width*10"
myshp.Cells("TxtHeight").Formula = "Height*1"
myshp.Cells("TxtPinX").Formula = "Width*1"
myshp.Cells("TxtPinY").Formula = "Height*0.5"
myshp.Cells("TxtLocPinX").Formula = "TxtWidth*0"
myshp.Cells("TxtLocPinY").Formula = "TxtHeight*0.5"
Next
Next

End Sub

 リクエストがレス数を越えていますので最終レスを表示しています。

: 名前:投稿日:


雑談その他トップへ ▲カッ飛び先頭