V
Victor Dong
I try Office 2000 + SP3, and Office 2003, the issue happen in both version
word. Below is my VB code
Private m_Document As Word.Document 'Word document object
Public Sub AddPicture(ByVal strFile As String, _
ByVal sngLeft As Single, _
ByVal sngTop As Single
ByVal sngWidth As Single, _
ByVal sngHeight As Single)
Dim sngTop As Single 'Top for picture
Dim spPicture As Word.Shape 'shape of picture
m_Document.InlineShapes.AddPicture strFile, True, True
Set spPicture =
m_Document.InlineShapes(m_Document.InlineShapes.Count).ConvertToShape
spPicture.RelativeHorizontalPosition =
wdRelativeHorizontalPositionPage
spPicture.RelativeVerticalPosition =
wdRelativeHorizontalPositionPage
spPicture.Left = (.sngWidth - .sngLeft - .sngRight - sngWidth) / 2
spPicture.Top = sngTop
spPicture.Width = sngWidth
spPicture.Height = sngHeight
‘Below is inserting Shape directly, but it has same issue
'm_Document.Shapes.AddPicture strFile, True, True, _
sngLeft , sngTop, sngWidth, sngHeight
End Sub
word. Below is my VB code
Private m_Document As Word.Document 'Word document object
Public Sub AddPicture(ByVal strFile As String, _
ByVal sngLeft As Single, _
ByVal sngTop As Single
ByVal sngWidth As Single, _
ByVal sngHeight As Single)
Dim sngTop As Single 'Top for picture
Dim spPicture As Word.Shape 'shape of picture
m_Document.InlineShapes.AddPicture strFile, True, True
Set spPicture =
m_Document.InlineShapes(m_Document.InlineShapes.Count).ConvertToShape
spPicture.RelativeHorizontalPosition =
wdRelativeHorizontalPositionPage
spPicture.RelativeVerticalPosition =
wdRelativeHorizontalPositionPage
spPicture.Left = (.sngWidth - .sngLeft - .sngRight - sngWidth) / 2
spPicture.Top = sngTop
spPicture.Width = sngWidth
spPicture.Height = sngHeight
‘Below is inserting Shape directly, but it has same issue
'm_Document.Shapes.AddPicture strFile, True, True, _
sngLeft , sngTop, sngWidth, sngHeight
End Sub