OOobbs3/111
質問
以下のコードで画像ファイルを連続で挿入したいのですが、 1枚目は入ります、2枚目はダイアログが出て選択の後入りますが、 コードのdispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, args2()) この位置でエラーが出て進みません。解決方法無いですか? sub Jan_Paste dim document as object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") oDoc = ThisComponent oController = oDoc.CurrentController() oSheet = oDoc.Sheets().getByName("Print") AA = 0 Label2: oNum = oSheet.getCellbyPosition(7,AA)'行番号1~ Hinban = oSheet.getCellbyPosition(13,AA)'品番 IF oNum.Value = 0 Then Exit Sub End IF IF oNum.Value = 1 Then oRow = 0 oCol = 2 Goto Label1 End IF IF oNum.Value Mod 2 = 0 Then'偶数 IF oNum.Value Mod 6 = 1 Then oRow = 3 oCol = oCol + 5 - 1 Else oRow = 3 End IF Else IF oNum.Value Mod 6 = 1 Then oRow = 0 oCol = oCol + 5 - 1 Else oRow = 0 oCol = oCol + 5 End IF End IF Label1: 'msgbox oRow & "," & oCol oController.select (oSheet.getCellByPosition(oRow,oCol))'貼り付ける位置 dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "FileName" args2(0).Value = ConvertToURL("file:///E:/Users/Kenji/Documents/solnoire/RavelPrint/JAN13/" & Hinban.String & ".emf") 'args2(1).Name = "FilterName" 'args2(1).Value = "EMF - Enhanced Metafile" 'args2(2).Name = "AsLink" 'args2(2).Value = false dispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, args2()) AA = AA + 1 Goto Label2 end sub 回答
感想,コメント,メモ
|