• ベストアンサー

【マクロ】ワードアートの文字の輪郭を消す

excel 2010です。 ワードアートの文字の輪郭を消すマクロを作りたいのですが、 マクロの記憶で、作られた以下のコードでは、消えません。 どうすれば、消せますか。 よろしくお願いします。 Sub Macro() ActiveSheet.Shapes.AddTextEffect(msoTextEffect1,"ABC","Times New Roman",128,False,False,0,0).Select Selection.ShapeRange.TextFrame2.TextRange.Font.Line.Visible = msoFalse End Sub

質問者が選んだベストアンサー

  • ベストアンサー
回答No.1

こんにちは。 > ワードアートの文字の輪郭を ... どうすれば、消せますか。 ワードアートの3D効果はそのままに、ただ文字の輪郭を消す、ということでしたら、 ご提示のマクロの2行めを Selection.ShapeRange.TextFrame2.TextRange.Font.Line.Transparency = 1 のように置き換えれば、見た目上、消すことができます。 Selection.ShapeRange.TextFrame2.TextRange.Font.Line.Visible = msoFalse この記述を実行しても何も起こりません。理由はわかりません。 .Font.Line.Visible プロパティを変更する、他の方法については、 今と処必要を感じていないので、探していませんが、 もしも、お求めでしたら、その理由を補足として書いてください。 ワードアートの文字の輪郭を消す、他の方法については、 最初に示した通りです。 以上です。

anon256
質問者

お礼

Transparency = 1 なるほど。 使わせていただきます。 ありがとうございました。

関連するQ&A

  • エクセル。マクロの記録で出来たVBAを書き直したい。

    エクセル2000(OSはWindows2000)でマクロの記録を行いました。 四角形を出してA1セルにリンクさせフォント等の設定をしたものです。 Sub Macro5() ActiveSheet.Shapes.AddShape(msoShapeRectangle, 200#, 100#, 140#, 80#). _ Select ExecuteExcel4Macro "FORMULA(""=R1C1"")" With Selection.Font .Name = "Century Gothic" .FontStyle = "太字" .Size = 72 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse End Sub これを、実際には四角形をセレクトしないで実行させたいのです。 With ActiveSheet.Shapes.AddShape~ End With といった形になるのでしょうが、どうもうまく出来ません。 ご教示いただければ幸いです。

  • エクセルマクロでオブジェクトを選択する方法

    エクセル(2002)を使っています。マクロの記録機能を使って円を描くマクロを作成しました。 Sub Maru(xpos, ypos, hankei) ActiveSheet.Shapes.AddShape(msoShapeOval, xpos, ypos, hankei, hankei).Select Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.SchemeColor = 64 Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255) End Sub 次にこの円を削除したいと思い、同じようにマクロの記録機能を使ったところ、 Sub Macro3() ActiveSheet.Shapes("Oval 64").Select Selection.Delete End Sub となりました。"Oval 64"はオブジェクトの名前のようですが、名前がわかっていないオブジェクト(但し上記マクロで書いたので場所はわかっている)を選択するにはどうしたらいいでしょうか。

  • マクロを使ってexcel2007でテキストボックス内をセンタリングしたい

    以前、excel2000でマクロの児童記録で記録し、それを利用して 下のようなマクロを使っていました (列ボックス1は変数) ActiveSheet.Shapes.AddTextbox(msoTextOrientationVerticalFarEast, 列ボックス1, 205 , 15, 105).Select Selection.Characters.Text = 顧客名 With Selection.Characters.Font .Name = "MS Pゴシック" .FontStyle = "標準" .Size = 8 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 3 End With With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlTop .Orientation = xlVertical .AutoSize = False .AddIndent = False End With Selection.ShapeRange.Fill.Visible = False Selection.ShapeRange.Fill.Solid Selection.ShapeRange.Fill.Transparency = 1# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse Selection.ShapeRange.TextFrame.MarginLeft = 0 Selection.ShapeRange.TextFrame.MarginRight = 0 Selection.ShapeRange.TextFrame.MarginTop = 0 Selection.ShapeRange.TextFrame.MarginBottom = 0 これで問題なく動作していたのですが excel2007で動作させると テキストボックス内が水平方向にセンタリングされていません。 excel2007でテキストボックスをかく記録をしてもマクロには何も残らず 困っています。 excel2007でも、センタリングさせる方法を教えて下さい どうかよろしくお願いします

  • エクセルVBAでテキストボックスに文字

    Excel2016です。 ワークシート上に配置した、図形の「テキストボックス」に文字を入れるVBAについての質問です。 下記のTEST01では期待通り文字が入りますが、これはテキストボックスをSelectしなければなりません。 TEST02ならSelectせずにOKかと思ったら実行時エラーとなりました。 どのように修正したらよろしいのでしょうか? Sub TEST01()   Sheets(“Sheet1”).Shapes.Range(Array("TextBox 3")).Select   Selection.ShapeRange.TextFrame2.TextRange.Characters.Text = "TEST/TEST/2020"   Selection.ShapeRange.TextFrame2.TextRange.Font.Name = "Meiryo UI"   Selection.ShapeRange.TextFrame2.TextRange.Font.Bold = msoTrue End Sub Sub TEST02()   With Sheets(“Sheet1”).Shapes.Range(Array("TextBox 3"))     .ShapeRange.TextFrame2.TextRange.Characters.Text = "TEST/TEST/2020"     .ShapeRange.TextFrame2.TextRange.Font.Name = "Meiryo UI"     .ShapeRange.TextFrame2.TextRange.Font.Bold = msoTrue   End With End Sub

  • Excel マクロ 任意のセルから実行したい

    こんにちは、Excel2003を使用しています。 ExcelでK55からE55までのセルの値を削除して(空白にして) それぞれに「---を引いた透明のダイアローグボックス」を コピーしていくマクロを作成したことがあります。 このときは開始するセルがK55と決まっていたのですが 今度は任意のセルから(たとえば選択したセルの右隣とか) 実行したいのですがどのようにマクロを作ればよいでしょうか ご存じの方お教えください。 なお参考に上記のマクロを記載します。 Range("E55:J55").Select Selection.ClearContents Range("H55").Select ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 672#, 729#, _ 81#, 13.5).Select Selection.Characters.Text = "" With Selection.Font .Name = "MS Pゴシック" .FontStyle = "標準" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.ShapeRange.Fill.Visible = msoFalse 'Selection.ShapeRange.Fill.Solid 'Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse ActiveSheet.Shapes("Text Box 12").Select Selection.Characters.Text = "---" With Selection.Characters(Start:=1, Length:=3).Font .Name = "MS Pゴシック" .FontStyle = "標準" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.HorizontalAlignment = xlCenter Range("K55").Select ActiveSheet.Shapes("Text Box 12").Select Selection.Copy Range("I55").Select ActiveSheet.Paste Range("H55").Select ActiveSheet.Paste Range("G55").Select ActiveSheet.Paste Range("F55").Select ActiveSheet.Paste Range("E55").Select ActiveSheet.Paste Range("E56").Select Selection.Copy Range("F56:J56").Select ActiveSheet.Paste Application.CutCopyMode = False Range("E56:J56").Select Selection.Copy Range("E57:E59").Select ActiveSheet.Paste Application.CutCopyMode = False Range("K59").Select End Sub

  • Excel 任意のセルを指定する方法

    Excel 任意のセルを指定する方法 こんにちは Excel2003でセルの上を「---」で覆うマクロを作成しました。(以下参照) でもこれはセル「K2」に作成されます。 任意の作成したいセルを「---」で覆うようにするのには どのように改造すればよいでしょうか? おわかりの方お教えください。 ' 透明なセルを一つ作るマクロ ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 672.75, 13.5, _ 81#, 13.5).Select Selection.Characters.Text = "---" With Selection.Characters(Start:=1, Length:=3).Font .Name = "MS Pゴシック" .FontStyle = "標準" .Size = 11 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.HorizontalAlignment = xlCenter Selection.ShapeRange.Fill.Visible = msoFalse 'Selection.ShapeRange.Fill.Solid 'Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Visible = msoFalse Range("K2").Select End Sub

  • Excel マクロでチェックボックスに枠線

    エクセルマクロについて教えて下さい。 Excel2003を使用しています。 1つのシートに、フォームツールボックスからチェックボックスを沢山(300個以上)配置しました。 チェックボックスをクリック(オン)するのと同時にチェックボックスに赤い枠線を付けたいのですが、1つのマクロでチェックボックスのオブジェクト名を取得しながら枠線を付けることは出来ませんでしょうか? 以下のマクロを試してみたのですが、Application.Callerの所でエラーになってしまいました。 Sub checkon() ActiveSheet.Shapes(Application.Caller).Select Selection.ShapeRange.Line.Weight = 3# Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.ForeColor.SchemeColor = 10 i = ActiveCell.Address(False, False, xlA1) Range(i).Select End Sub 特定のチェックボックスを指定した場合は、問題ないのですが・・。 (例)ActiveSheet.Shapes("Check Box 1").Select どなたか詳しい方、宜しくお願い致します。

  • エクセルで簡単なオートシェイプのマクロをつくりました マクロの実行とステップごとの実行の結果がちがってしまいます

    オートシェイプを使った簡単な寸法線の入った図をマクロで書きました。 ステップごとだと期待どおりのアウトプットなのですが、ダイレクトにマクロを実行すると途中のステップがとんでしまうようです。 どうしてでしょうか。 教えてください。 1 Sub 寸法線1() 2 Dim l1, l2, l3, l4, lb, la1, la2, fig1, fig2, fig3, fig4 As Shape 3 x1 = 200 4 y1 = 500 5 x2 = x1 + 100 6 k = Cells(7, 5).Value / Cells(7, 4).Value 7 y2 = y1 - 100 * k 8 Set l1 = ActiveSheet.Shapes.AddLine(x1, y1, x2 + 20, y1) 9 Set l2 = ActiveSheet.Shapes.AddLine(x1, y1, x1, y2 - 15) 10 Set lb = ActiveSheet.Shapes.AddLine(x1, y1, x2, y2) lb.Line.Weight = 2# 11 Set l3 = ActiveSheet.Shapes.AddLine(x2 + 5, y2, x2 + 20, y2) 12 Set l4 = ActiveSheet.Shapes.AddLine(x2, y2 - 5, x2, y2 - 15) 13 Set la1 = ActiveSheet.Shapes.AddLine(x2 + 12.5, y1 - 2, x2 + 12.5, y2 + 2) 14 la1.Line.BeginArrowheadStyle = msoArrowheadTriangle 15 la1.Line.BeginArrowheadLength = msoArrowheadLengthMedium 16 la1.Line.BeginArrowheadWidth = msoArrowheadWidthMedium 17 la1.Line.EndArrowheadStyle = msoArrowheadTriangle 18 la1.Line.EndArrowheadLength = msoArrowheadLengthMedium 19 la1.Line.EndArrowheadWidth = msoArrowheadWidthMedium 20 Set la2 = ActiveSheet.Shapes.AddLine(x1 + 2, y2 - 10, x2 - 2, y2 - 10) 21 la2.Line.BeginArrowheadStyle = msoArrowheadTriangle 22 la2.Line.BeginArrowheadLength = msoArrowheadLengthMedium 23 la2.Line.BeginArrowheadWidth = msoArrowheadWidthMedium 24 la2.Line.EndArrowheadStyle = msoArrowheadTriangle 25 la2.Line.EndArrowheadLength = msoArrowheadLengthMedium 26 la2.Line.EndArrowheadWidth = msoArrowheadWidthMedium 27 Set fig1 = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _ x1 - 10, y1 + 5, 17, 17) 28 fig1.Select 29 Selection.Characters.Text = Str(Cells(6, 3)) 30 Selection.Characters.Font.Bold = True 31 Selection.ShapeRange.Line.Visible = msoFalse 32 Set fig2 = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _ x2 + 5, y2 - 20, 18, 18) 33 fig2.Select 34 Selection.Characters.Text = Str(Cells(7, 3)) 35 Selection.Characters.Font.Bold = True 36 Selection.ShapeRange.Line.Visible = msoFalse 37 Set fig3 = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, _ x1 + (x2 - x1) * 0.5 - 13, y2 - 32, 45, 17) 38 fig3.Select 39 Selection.Characters.Text = Str(Cells(7, 4)) 40 Selection.ShapeRange.Line.Visible = msoFalse 41 Set fig4 = ActiveSheet.Shapes.AddTextbox(msoTextOrientationUpward, _ x2 + 15, y1 - 0.5 * (y1 - y2) - 8, 17, 45) 42 fig4.Select 43 Selection.Characters.Text = Str(Cells(7, 5)) 44 Selection.ShapeRange.Line.Visible = msoFalse 45 MsgBox "pause" 46 Call l1.Select 47 Call l2.Select(False) 48 Call l3.Select(False) 49 Call l4.Select(False) 50 Call lb.Select(False) 51 Call la1.Select(False) 52 Call la2.Select(False) 53 Call fig1.Select(False) 54 Call fig2.Select(False) 55 Call fig3.Select(False) 56 Call fig4.Select(False) 57 MsgBox "hit any" 58 Selection.ShapeRange.Group.Delete 59 End Sub Cells(7, 5)=50 cells(7,4)=100 cells(6,3)=1 cells(7,3)=2 です。 左端に行番号をふってあります。 36から44まで飛んでしまいます。 節点 座標 X Y 1 0 0 2 100 50

  • Word2007マクロ

    宜しくお願い致します Word2007でこんな事が出来ますか Excel2007で線路を作るマクロを作成しました(本を見て) これをWordでも使用したいのですが、Excelのマクロそのまま WordのVisual Basicに書き込んでもエラーが出て機能しません Excelのマクロは以下です Sub 線路作成() 上端位置 = Selection.Top 左端位置 = Selection.Left  Selection.ShapeRange.Line.Weight = 6# Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Duplicate.Select Selection.ShapeRange.IncrementLeft -18# Selection.ShapeRange.IncrementTop 9.6 Selection.ShapeRange.Line.DashStyle = msoLineDash Selection.ShapeRange.Line.Weight = 4.5 Selection.ShapeRange.Line.Visible = msoTrue Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.ForeColor.SchemeColor = 9 Selection.ShapeRange.Line.Visible = msoTrue Selection.Top = 上端位置 Selection.Left = 左端位置 End Sub Wordで使えるようにするには、どこを直せばよいでしょうか。

  • エクセル・マクロでグラフを最背面に移動させたい

    エクセルのグラフを3つピッタリと重ねて表示しています 後ろのグラフを選択する時「最背面に移動」させてますが これをマクロにしたいです とりあえずマクロの記録でしてみたら Sub Macro1() ActiveSheet.ChartObjects("グラフ 7").Activate ActiveChart.ChartArea.Select Selection.ShapeRange.ZOrder msoSendToBack ActiveWindow.Visible = False Windows("Book1.xls").Activate Range("A1").Select ActiveSheet.ChartObjects("グラフ 5").Activate ActiveChart.ChartArea.Select Selection.ShapeRange.ZOrder msoSendToBack ActiveWindow.Visible = False Windows("Book1.xls").Activate Range("A1").Select ActiveSheet.ChartObjects("グラフ 2").Activate ActiveChart.ChartArea.Select Selection.ShapeRange.ZOrder msoSendToBack ActiveWindow.Visible = False Windows("Book1.xls").Activate Range("A1").Select End Sub と出来たのですが、マクロの実行そしてみると3列目の Selection.ShapeRange.ZOrder msoSendToBack の所で、 「実行時エラー438 オブジェクトはこのプロパティまたはメソッドをサポートしてません」 となってしまいます、どうすればよいのでしょう ボタンを押したら最前面のグラフが最背面に移動するようにしたいのですが難しいのでしょうか

専門家に質問してみよう