There is a funny behaviour of Word 2007 regarding graphics

V

Volker Tornow

see the following simple makro for word 2007; try using on the one hand the
save format: wdFormatDocument and on the other the format:
wdFormatXMLDocument. With the first format the resulting height of the pic is
greater than the width using the new format it is vice versa, so an automatic
scaling will fail in the new xml format

Sub testMakro()
'
' testMakro Makro
'
' the emf-picture has an original size of width = 32 cm and height = 16 cm
'
' try wdFormatDocument and then wdFormatXMLDocument
' and see the differences in picheight and picwidth
'
Dim myFormat As Integer
myFormat = wdFormatDocument ' in a second run use wdFormatXMLDocument

ActiveDocument.SaveAs "C:\temp\shit.doc", myFormat

Dim dum As InlineShape
Dim fig As Shape
Dim picheight As Integer, picwidth As Integer
Set dum = Selection.InlineShapes.AddPicture("C:\temp\AUSGABE.EMF", False,
True)
Set fig = dum.ConvertToShape
fig.Rotation = 270
Set dum = fig.ConvertToInlineShape
ih = dum.Height
iw = dum.Width
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top