回复 30# kk_lee69
昨天下载你的图片显示像素是400,今天下载又显示是96了。如图为ps图像调整大小时的对话框。
你还是对不准,是不是shaps的属性RelativeHorizontalPosition 要多试一下
用法:With ActiveDocument.Shapes("split#=" & ii)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Left = pgwd - mywidth - temp_edge '靠右边
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Top = temp_topwz
End With
WdRelativeHorizontalPosition 。
枚举
指定图文框、形状或一组行的水平位置所相对的对象。
版本信息
已添加版本:
名称 值 说明
wdRelativeHorizontalPositionCharacter 3 相对于字符。
wdRelativeHorizontalPositionColumn 2 相对于列。
wdRelativeHorizontalPositionMargin 0 相对于边距。
wdRelativeHorizontalPositionPage 1 相对于页面。
wdRelativeHorizontalPositionInnerMarginArea 6 相对于内空白区。
wdRelativeHorizontalPositionLeftMarginArea 4 相对于左边距。
wdRelativeHorizontalPositionOuterMarginArea 7 相对于外空白区。
wdRelativeHorizontalPositionRightMarginArea 5 相对于右边距。
另外由于改成1.6宽,txt宽度要适当调宽一些,我又改微调了一下,我在公司的电脑2010也可行:Sub insertpic()
'
' 筿?彻?ボ虫ノ
'
PLeft = Selection.Information(wdHorizontalPositionRelativeToPage)
PTop = Selection.Information(wdVerticalPositionRelativeToPage)
PLPOS = Selection.Information(wdHorizontalPositionRelativeToTextBoundary)
Dim Sh1, Sh2 As Object, PS As Object
Set PS = ThisDocument.PageSetup
'MsgBox (PLeft & " " & PTop)
Dim arr(0 To 1) As Variant
Set myDocument = ActiveDocument
With myDocument.Shapes
With .AddPicture(FileName:="E:\SW\Studydoc\office\word\Au3_KK_lee69 problem\2\999_2.jpg", LinkToFile:=False, SaveWithDocument:=True, Left:=PS.LeftMargin, Top:=PS.TopMargin)
.Name = "shp1"
arr(0) = .Name
End With
Set Sh1 = ThisDocument.Shapes("shp1")
Sh1.Select
With ThisDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, PS.LeftMargin, PS.TopMargin, Sh1.Width * 2, Sh1.Height)
.Name = "shp2"
.Line.Visible = msoFalse
.Fill.Transparency = 1
With .TextFrame
.VerticalAnchor = msoAnchorMiddle
With .TextRange
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Font.Size = 7.5
'.Font.Name = "夹发砰"
.Font.ColorIndex = wdBlue
.Text = Format(Date, "yyyy.mm.dd")
End With
End With
End With
Set Sh2 = ThisDocument.Shapes("shp2")
Dim target_left, target_top As Single
With Sh1
target_left = .Left
target_top = .Top
End With
With Sh2
.Left = target_left - (Sh1.Width / 2)
.Top = target_top
End With
' With .Range(Array("shp1", "shp2")).Group
'.Fill.PresetTextured msoTextureBlueTissuePaper
'.Rotation = 45
' .ZOrder msoSendToBack
' End With
End With
End Sub
|