Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2008

Tip: Looking for answers? Try searching our database.

Application.Visible = true does not focus on the application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
melon - 07 Feb 2008 20:54 GMT
I have a Outlook macro that will generate a customized Word document
for a given meeting request.  I found out PrintOut does not give you a
print dialog box so I just set Application.Visible = true to let the
user print the stuff themselves.

However, sometimes Word will appear but remain in the background.  I
think this is due to the Outlook prompt "Some program is trying to
access an address from Outlook".  Is there any way that I can either

a) Bring up the print dialog window
b) Focus (bring to front) the word document.
Shauna Kelly - 07 Feb 2008 21:18 GMT
Hi melon

If appWord is a reference to the Word application, then try
   appWord.Activate

That should bring Word to the front and give it the focus.

If docMyDocument is a reference to the document you've created, then try
   docMyDocument.Activate

That should bring docMyDocument to the front and give it the focus.

Finally, if you want to display the print dialog box, activate the
relevant document, and then
   Dialogs(wdDialogFilePrint).Show
For more information about that, see

Getting help with calling Word's built-in dialogs using VBA (and why
doing so can be much more useful than you'd think)
http://www.word.mvps.org/FAQs/MacrosVBA/TaskPanesReference.htm

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>I have a Outlook macro that will generate a customized Word document
> for a given meeting request.  I found out PrintOut does not give you a
[quoted text clipped - 7 lines]
> a) Bring up the print dialog window
> b) Focus (bring to front) the word document.
Shauna Kelly - 08 Feb 2008 01:57 GMT
Wrong reference. It should be:

Getting help with calling Word's built-in dialogs using VBA (and why
doing so can be much more useful than you'd think)
http://www.word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Hi melon
>
[quoted text clipped - 35 lines]
>> a) Bring up the print dialog window
>> b) Focus (bring to front) the word document.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.