Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting most recent document 1

Status
Not open for further replies.

chris921

Technical User
Mar 9, 2004
82
GB
Hi

My program opens Microsoft Word documents and allows the user to choose from a combobox in the program what codes to insert to the document.

However it only works correctly for the first opened document (ie works fine if no other word docs are open prior to running the program but if they are then the first document opened (chronologically) is the one that receives the codes)

Is there a way for me to say that I want the document opened by the user (selected from a filelist box in the program) to be the active document?

Thanks in advance,

Chris
 
I usually record a Word macro and edit the code produced - in this case the macro produces
Code:
Windows("mydoc.doc").Activate
Wher mydoc.doc is the name of the file you wish to activate. You will need to add the reference to your word app.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top