Modification of sound badge in MSWord



  • I'm forming a MSWord’s document, and I'm putting sound files in it from the OBD.

    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 a size-defined plate.
    I want to lower these badges.
    I'd look at it in the macs, but the whole thing is, during the macro recording, there's no way to change the size. You can only change after the macro recording's over.
    Although the last parameter of "AddOLEObject" is "LRange" - but I don't think it's a theory, https://msdn.microsoft.com/en-us/library/office/ff835835(v=office.15).aspx ♪
    Macrose. MSWord It 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 you translate into Delphi,

    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 there are two objects with different altitude and width.
    Do I have to adjust the object to the dimensions before I get up?



  • Somehow:

    var
      MyOLEObject: T{что_там_возвращает_AddOLEObject};
    ...
    MyOLEObject := WordApplication1.Selection.InlineShapes.AddOLEObject(LClassType, LFileName, LLinkToFile, LDisplaySaIcon, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
    MyOLEObject.Height := 20;
    MyOLEObject.Width := 20;
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2