I form the MS Word document, and insert sound files from the database.
var LClassType, LFileName, LLinkToFile, LDisplaySaIcon, LIconFileName, LIconIndex, LIconLabel, LRange: Olevariant; begin … LClassType := 'Package'; LFileName := PrPathForVoice+ibqEmpty.FieldByName('EW1').AsString+'.mp3'; LLinkToFile := false; LDisplaySaIcon := false; WordApplication1.Selection.InlineShapes.AddOLEObject(LClassType, LFileName, LLinkToFile, LDisplaySaIcon, EmptyParam, EmptyParam, EmptyParam, EmptyParam); … end; In Word, they look like icons (labels) of a certain size.
I want to reduce the size of these icons .
I would look at it in the macro itself, but the thing is that during the recording of the macro, it is impossible to resize. It can be changed only after the end of the macro recording.
Although the last parameter of the "AddOLEObject" function is "LRange" - but in my opinion, it’s not quite a bit, considering .
The macro in MSWord looks like this:
Set y = Selection.InlineShapes.AddOLEObject(ClassType:="Package", FileName:= _ "D:\Prog\Eng_gdb\Documents\Voice\accept.mp3", LinkToFile:=False, _ DisplayAsIcon:=False) y.Height = 20 y.Width = 20 But if translated into Delphi, then:
WordApplication1.Selection.InlineShapes.AddOLEObject(LClassType, LFileName, LLinkToFile, LDisplaySaIcon, EmptyParam, EmptyParam, EmptyParam, EmptyParam).Height := 20; WordApplication1.Selection.InlineShapes.AddOLEObject(LClassType, LFileName, LLinkToFile, LDisplaySaIcon, EmptyParam, EmptyParam, EmptyParam, EmptyParam).Width := 20; But this adds two objects with different heights and widths.
Do I somehow need to assign dimensions to an object before insertion?