[ 初めての方へ | 一覧(最新更新順) | 全文検索 | 過去ログ ]
『outlookに貼り付けた画像のサイズを調整したいです。』(vba素人)
エクセルの表をoutlookに画像として貼り付けるコードを書きました。
メールを印刷する時にちょうど良いサイズになるよう、貼り付け後のサイズ指定をしたいのですが、どのようなコードを追加すればよいでしょうか。
よろしくお願い致します。
dim ap as object
set ap =createobject("outlook.application")
set w1=worksheets("コメント")
dim g as long
g=w1.cells(rows.count,1).end(xlup).row
with ap.activeinspector.wordeditor.windows(1).selection
w1.select
range(cells(1,1),cells(g,1)).select
selection.copypicture
.paste
.typetext chr(13)&chr(13)
end with
< 使用 Excel:Excel2010、使用 OS:unknown >
Dim ap As Object, beforeheight As Variant, w1 As Worksheet, g As Long Set ap = CreateObject("outlook.application") Set w1 = Worksheets("コメント") g = w1.Cells(Rows.Count, 1).End(xlUp).Row With ap.ActiveInspector.wordeditor.Windows(1).Selection w1.Select beforeheight = Range(Cells(1, 1), Cells(g, 1)).RowHeight Range(Cells(1, 1), Cells(g, 1)).RowHeight = 30 'ちょうど良いサイズになるよう数字は適宜変える。 Range(Cells(1, 1), Cells(g, 1)).Select Selection.CopyPicture .Paste Range(Cells(1, 1), Cells(g, 1)).RowHeight = beforeheight .TypeText Chr(13) & Chr(13) End With End Sub (mm) 2018/01/30(火) 18:30
[ 一覧(最新更新順) ]
YukiWiki 1.6.7 Copyright (C) 2000,2001 by Hiroshi Yuki.
Modified by kazu.