PC Review


Reply
Thread Tools Rate Thread

Display MsbBox in Word using Excel VBA

 
 
=?Utf-8?B?QWxleCBTdC1QaWVycmU=?=
Guest
Posts: n/a
 
      16th Mar 2007
Hi,
I would like to make a popup (msgbox) in word using Excel VBA.
Any idea ?
something like..
Set appWord = New Word.Application
appWord.MsbBox = "Report created"
Thanks!
Alex
--
Alex St-Pierre
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      19th Mar 2007
You probably want the messagebox in the same Word instance which contains
the report, assuming that's why you're using Word.

Earlier in the routine you probably have one of these:

Set appWord = New Word.Application
Set appWord = CreateObject("Word.Application")
Set appWord = GetObject(, "Word.Application")

and then you create the report within appWord. Don't kill appWord until
after you've executed this line:

appWord.MsgBox "Report created", vbExclamation, "Message"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Alex St-Pierre" <(E-Mail Removed)> wrote in message
news5A9E2BF-1A8E-429E-915F-(E-Mail Removed)...
> Hi,
> I would like to make a popup (msgbox) in word using Excel VBA.
> Any idea ?
> something like..
> Set appWord = New Word.Application
> appWord.MsbBox = "Report created"
> Thanks!
> Alex
> --
> Alex St-Pierre



 
Reply With Quote
 
=?Utf-8?B?QWxleCBTdC1QaWVycmU=?=
Guest
Posts: n/a
 
      19th Mar 2007
Hi Jon,

When I try to write appWord.* , I don't have MsgBox choice and it doesn't
work if I write it ? appWord.Application.MsgBox doesn't work too. I seems
that msgbox is in class interaction. Do you have an other idea?
Thanks!
Alex
Set appWord = New Word.Application
appWord.Visible = True
Set MyDocWord = appWord.Documents.Add
--
Alex St-Pierre


"Jon Peltier" wrote:

> You probably want the messagebox in the same Word instance which contains
> the report, assuming that's why you're using Word.
>
> Earlier in the routine you probably have one of these:
>
> Set appWord = New Word.Application
> Set appWord = CreateObject("Word.Application")
> Set appWord = GetObject(, "Word.Application")
>
> and then you create the report within appWord. Don't kill appWord until
> after you've executed this line:
>
> appWord.MsgBox "Report created", vbExclamation, "Message"
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> http://PeltierTech.com
> _______
>
>
> "Alex St-Pierre" <(E-Mail Removed)> wrote in message
> news5A9E2BF-1A8E-429E-915F-(E-Mail Removed)...
> > Hi,
> > I would like to make a popup (msgbox) in word using Excel VBA.
> > Any idea ?
> > something like..
> > Set appWord = New Word.Application
> > appWord.MsbBox = "Report created"
> > Thanks!
> > Alex
> > --
> > Alex St-Pierre

>
>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      19th Mar 2007
I searched the excel newsgroups for "msgbox word" and found this hit from
Orlando Magalhães Filho.

http://groups.google.co.uk/group/mic...3dbe5d951282a6

or

http://snipurl.com/1dfpi

========

Sub MsgBoxOverWord()
Dim WordApp As Object
Set WordApp = CreateObject("word.application")
With WordApp
.Visible = True
.Documents.Add
WordApp.WordBasic.MsgBox "Hi!", 1
.Quit
End With
End Sub

Harald Staff added a link to show how to use an API call to put the message box
atop any application.



Alex St-Pierre wrote:
>
> Hi,
> I would like to make a popup (msgbox) in word using Excel VBA.
> Any idea ?
> something like..
> Set appWord = New Word.Application
> appWord.MsbBox = "Report created"
> Thanks!
> Alex
> --
> Alex St-Pierre


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      19th Mar 2007
ps. That worked for me in xl2003.

Alex St-Pierre wrote:
>
> Hi,
> I would like to make a popup (msgbox) in word using Excel VBA.
> Any idea ?
> something like..
> Set appWord = New Word.Application
> appWord.MsbBox = "Report created"
> Thanks!
> Alex
> --
> Alex St-Pierre


--

Dave Peterson
 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      20th Mar 2007
You could either follow up on Dave's suggestions, or just use

MsgBox "Report created", vbExclamation, "Message"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Alex St-Pierre" <(E-Mail Removed)> wrote in message
news:9EB28038-72A3-4FA8-9266-(E-Mail Removed)...
> Hi Jon,
>
> When I try to write appWord.* , I don't have MsgBox choice and it doesn't
> work if I write it ? appWord.Application.MsgBox doesn't work too. I seems
> that msgbox is in class interaction. Do you have an other idea?
> Thanks!
> Alex
> Set appWord = New Word.Application
> appWord.Visible = True
> Set MyDocWord = appWord.Documents.Add
> --
> Alex St-Pierre
>
>
> "Jon Peltier" wrote:
>
>> You probably want the messagebox in the same Word instance which contains
>> the report, assuming that's why you're using Word.
>>
>> Earlier in the routine you probably have one of these:
>>
>> Set appWord = New Word.Application
>> Set appWord = CreateObject("Word.Application")
>> Set appWord = GetObject(, "Word.Application")
>>
>> and then you create the report within appWord. Don't kill appWord until
>> after you've executed this line:
>>
>> appWord.MsgBox "Report created", vbExclamation, "Message"
>>
>> - Jon
>> -------
>> Jon Peltier, Microsoft Excel MVP
>> Tutorials and Custom Solutions
>> http://PeltierTech.com
>> _______
>>
>>
>> "Alex St-Pierre" <(E-Mail Removed)> wrote in
>> message
>> news5A9E2BF-1A8E-429E-915F-(E-Mail Removed)...
>> > Hi,
>> > I would like to make a popup (msgbox) in word using Excel VBA.
>> > Any idea ?
>> > something like..
>> > Set appWord = New Word.Application
>> > appWord.MsbBox = "Report created"
>> > Thanks!
>> > Alex
>> > --
>> > Alex St-Pierre

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?QWxleCBTdC1QaWVycmU=?=
Guest
Posts: n/a
 
      20th Mar 2007
Thanks!!

Dave's suggesion is working good. Word 2002 recognize
appWord.WordBasic.MsgBox "Hi!"


--
Alex St-Pierre


"Jon Peltier" wrote:

> You could either follow up on Dave's suggestions, or just use
>
> MsgBox "Report created", vbExclamation, "Message"
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> http://PeltierTech.com
> _______
>
>
> "Alex St-Pierre" <(E-Mail Removed)> wrote in message
> news:9EB28038-72A3-4FA8-9266-(E-Mail Removed)...
> > Hi Jon,
> >
> > When I try to write appWord.* , I don't have MsgBox choice and it doesn't
> > work if I write it ? appWord.Application.MsgBox doesn't work too. I seems
> > that msgbox is in class interaction. Do you have an other idea?
> > Thanks!
> > Alex
> > Set appWord = New Word.Application
> > appWord.Visible = True
> > Set MyDocWord = appWord.Documents.Add
> > --
> > Alex St-Pierre
> >
> >
> > "Jon Peltier" wrote:
> >
> >> You probably want the messagebox in the same Word instance which contains
> >> the report, assuming that's why you're using Word.
> >>
> >> Earlier in the routine you probably have one of these:
> >>
> >> Set appWord = New Word.Application
> >> Set appWord = CreateObject("Word.Application")
> >> Set appWord = GetObject(, "Word.Application")
> >>
> >> and then you create the report within appWord. Don't kill appWord until
> >> after you've executed this line:
> >>
> >> appWord.MsgBox "Report created", vbExclamation, "Message"
> >>
> >> - Jon
> >> -------
> >> Jon Peltier, Microsoft Excel MVP
> >> Tutorials and Custom Solutions
> >> http://PeltierTech.com
> >> _______
> >>
> >>
> >> "Alex St-Pierre" <(E-Mail Removed)> wrote in
> >> message
> >> news5A9E2BF-1A8E-429E-915F-(E-Mail Removed)...
> >> > Hi,
> >> > I would like to make a popup (msgbox) in word using Excel VBA.
> >> > Any idea ?
> >> > something like..
> >> > Set appWord = New Word.Application
> >> > appWord.MsbBox = "Report created"
> >> > Thanks!
> >> > Alex
> >> > --
> >> > Alex St-Pierre
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
date display from excel in word [sven] Microsoft Excel Programming 2 11th Feb 2007 04:16 PM
Display Word, PDF files within Excel bprince Microsoft Excel Programming 0 14th Oct 2005 12:45 PM
Display Word Paragraphs in Excel??? =?Utf-8?B?cXVhcnR6?= Microsoft Excel Programming 2 10th Jan 2005 07:39 PM
msbbox lawson Microsoft Excel Programming 1 10th May 2004 06:10 PM
Possible to display a section from a Word or Excel doc into the Word or Excel files you are reading? Android Microsoft Word Document Management 4 19th Sep 2003 03:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:40 PM.