Recent

Author Topic: Focus or Showwindow of Microsoft Word  (Read 123 times)

w click

  • Full Member
  • ***
  • Posts: 161
Focus or Showwindow of Microsoft Word
« on: June 27, 2022, 06:37:11 pm »
I've a wordapp with a sourcedoc and it highlights the paragraph, but only when you click on it.  I've got to here, but wordapp.visible is already true and not needed, and activedocument does nothing.  Setofocus causes an exception.  This is Windows.
Code: Pascal  [Select][+][-]
  1.         try
  2.           sourcedoc.paragraphs(target+1).range.select;
  3. //          wordapp.setfocus;
  4.           wordapp.Visible:=true;
  5.           wordapp.ActiveDocument.Activate();
  6.  
  7.         except
  8.           showmessage('oops for '+inttostr(target));
  9.         end;
  10.  
I need to bring Word to the front and sort of click on it.  Can anyone help?

 

TinyPortal © 2005-2018