![]() |
| サイトマップ | |
|
トップ | オブジェクト | プロパティ | メソッド | 定数 |
TransposePaste メソッド |
オブジェクト:NativeWorksheetItem
クリップボードのデータを、行と列が入れ替わるように、データの行列インデックスを置き換えてワークシートにペーストします。クリップボードにデータがない場合、または、クリップボードのデータ形式が正しくない場合は何も起こりません。
ActiveDocument.CurrentDataItem.TransposePaste
Begin Dialog UserDialog 400,126,"Copy and Paste" ' %GRID:10,7,1,1 OKButton 310,14,70,21 GroupBox 20,42,270,70,"Copy",.GroupBox1 Text 20,14,270,21,"Current Worksheet: "+ activedocument.CurrentDataItem.Name,.Text1 OptionGroup .Group1 OptionButton 40,56,80,14,"Column",.OptionButton1 OptionButton 40,84,90,14,"Row",.OptionButton2 TextBox 240,70,40,21,.TextBox1 Text 140,70,100,14,"Index number:",.Text2 End Dialog Dim dlg1 As UserDialog dlg1.TextBox1="1" Dialog dlg1 Dim Selection(3) If dlg1.Group1=0 Then Selection(0) = CLng(dlg1.TextBox1)-1 Selection(1) = 0 Selection(2) = CLng(dlg1.TextBox1)-1 Selection(3) = &H7FFFFFF ActiveDocument.CurrentDataItem.SelectionExtent = Selection ActiveDocument.CurrentDataItem.Copy Else Selection(0) = 0 Selection(1) = CLng(dlg1.TextBox1)-1 Selection(2) = &H7FFFFFF Selection(3) = CLng(dlg1.TextBox1)-1 ActiveDocument.CurrentDataItem.SelectionExtent = Selection ActiveDocument.CurrentDataItem.Copy End If Dim NotebookItems$() ReDim NotebookItems$(ActiveDocument.NotebookItems.Count) Dim Index Index = 0 Dim index2 index2=0 Dim DataList$(ActiveDocument.NotebookItems.Count) Dim Item For Each Item In ActiveDocument.NotebookItems If ActiveDocument.NotebookItems(Index).ItemType = 1 Or ActiveDocument.NotebookItems(Index).ItemType = 8 Then DataList$(Index2) = ActiveDocument.NotebookItems(Index).Name index2=index2+1 End If Index = Index + 1 Next Item Begin Dialog UserDialog 420,238,"Paste" ' %GRID:10,7,1,1 Text 20,14,120,14,"Target Worksheet:",.Text1 DropListBox 160,14,150,84,DataList(),.DropListBox1 OKButton 330,14,70,21 GroupBox 20,49,280,77,"Paste Location",.GroupBox1 OptionGroup .Group1 OptionButton 40,70,80,14,"Column",.OptionButton1 OptionButton 40,98,80,14,"Row",.OptionButton2 Text 140,84,100,21,"Index number:",.Text2 TextBox 250,84,40,21,.TextBox1 GroupBox 20,140,280,77,"Paste Behavior",.GroupBox2 OptionGroup .Group2 OptionButton 40,161,220,14,"Shift existing cells down",.OptionButton3 OptionButton 40,182,170,21,"Overwrite existing cells",.OptionButton4 End Dialog Dim dlg2 As UserDialog dlg2.TextBox1=dlg1.TextBox1 Dialog dlg2 If dlg2.Group2=0 Then ActiveDocument.CurrentDataItem.InsertionMode = True End If ActiveDocument.NotebookItems(DataList(CLng(dlg2.DropListBox1))).Open If dlg2.Group1=0 Then ActiveDocument.CurrentDataItem.Goto(0,CLng(dlg2.TextBox1)-1) If dlg1.Group1=0 Then ActiveDocument.CurrentDataItem.Paste Else ActiveDocument.CurrentDataItem.TransposePaste End If Else ActiveDocument.CurrentDataItem.Goto(CLng(dlg2.TextBox1)-1,0) If dlg1.Group1=0 Then ActiveDocument.CurrentDataItem.TransposePaste Else ActiveDocument.CurrentDataItem.Paste End If End If ActiveDocument.NotebookItems("Data 1").InsertionMode= False