Reply
 
Thread Tools Display Modes
  #1   Report Post  
jcarson83 jcarson83 is offline
Junior Member
 
Posts: 1
Default Set an active window in VB

At the end of a macro I want to set a document that is already open to the active window. Whats the VB code for this?
  #2   Report Post  
NewsReader54
 
Posts: n/a
Default

jcarson83 schrieb:
At the end of a macro I want to set a document that is already open to
the active window. Whats the VB code for this?


Try this:

=== Start of Sub ===
Dim docTest As Word.Document
Dim docOtherDoc As Word.Document

Set docTest = Documents.Add
Selection.TypeText "Hallo this is the first doc."
Set docOtherDoc = Documents.Add
Selection.TypeText "This is the second doc."

'** Activate the first doc:
docTest.Activate

=== End of Sub

Regards
P-

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Window Opening Size in Internet Explorer El Barto Microsoft Word Help 3 July 16th 05 12:04 AM
How to display multiple docs in a single word window? steepcreep Microsoft Word Help 3 June 11th 05 09:25 PM
SAVE AS and EXPLORER WINDOW gman Microsoft Word Help 2 April 7th 05 09:29 PM
print window appear behind the active word doc sphilip Microsoft Word Help 1 February 28th 05 07:27 AM
maximized window not filling screen Mike Microsoft Word Help 0 January 24th 05 07:27 PM


All times are GMT +1. The time now is 12:21 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"