전체 확대, 축소 글꼴

993 단어 IntegerDelphi
매크로 녹음을 하면 실현 코드를 볼 수 있다
다음은delphi 실현입니다.
글꼴 확대
procedure ZoomInFontSize();
var
  doc: _Document;
  I: Integer;
  KeyType, ExtParam: OleVariant;
begin
  if FZooming then
    Exit;
    
  FZooming := True;
  doc := (FOfficeCtrl.ActiveDocument as _Document);
  doc.Application.Selection.WholeStory;
  for I := 1 to 9 do
    doc.Application.Selection.Font.Grow;
  KeyType := wdStory;
  ExtParam := EmptyParam;
  doc.Application.Selection.HomeKey( KeyType, ExtParam );         
end;

글꼴 축소
procedure ZoomOutFontSize;
var
  doc: _Document;
  I: Integer;
  KeyType, ExtParam: OleVariant;
begin
  if not FZooming then
    Exit;

  FZooming := False;
  doc := (FOfficeCtrl.ActiveDocument as _Document);
  doc.Application.Selection.WholeStory;
  for I := 1 to 9 do
    doc.Application.Selection.Font.Shrink;
  KeyType := wdStory;
  ExtParam := EmptyParam;
  doc.Application.Selection.HomeKey( KeyType, ExtParam );
end;

좋은 웹페이지 즐겨찾기