Word 2010 に次のマクロがあります。マクロを実行するときに値 1 (コペンハーゲン) を事前選択したいので、コペンハーゲンが事前選択されたドキュメントにコンテンツ コントロールのドロップダウン リストを配置します。
これを行うにはどうすればよいですか?:
Sub Cities()
'
' Cities Macro
'
'
Selection.Range.ContentControls.Add (wdContentControlDropdownList)
Selection.ParentContentControl.Title = "Cities"
Selection.ParentContentControl.LockContentControl = False
Selection.ParentContentControl.DropdownListEntries.Add Text:="Copenhagen", Value:="1"
Selection.ParentContentControl.DropdownListEntries.Add Text:="New York", Value:="2"
Selection.ParentContentControl.DropdownListEntries.Add Text:="London", Value:="3"
Selection.ParentContentControl.DropdownListEntries.Add Text:="Paris", Value:="4"
Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub
前もって感謝します!
/ アンダース H.