VBscript - controlling other office app

D

dziv

I have a gazillion Outlook programming books (including
Sue Mosher's) and I'm at my wit's end.

I have a custom Outlook form that opens a Word document
and fills out formfields with data the user provides
within the Outlook form. It then background prints the
Word document and saves it.

My question is this: does anyone know how to control
Outlook from Word via VBA, but I need to control the Word
application itself through VBscript. I need to leave the
revised document on the screen and have Outlook give
control (activate) to Word so the user can continuing
working in Word.

Thanks!
 
S

Sue Mosher [MVP-Outlook]

Word has an object model, just like Outlook does? Did you try its
Document.Activate method?
 
D

dziv

Hi Sue,

Thanks a bunch for responding. By the way, your book is
definitely my favorite!

Anyway, yes, I did try Docoment.Activate, to no avail. I
am able to leave the document on the screen, but not force
Outlook to give control to Word (make it visible). So,
the user must choose the Word document from the taskbar.
I know, I know, how pathetic, but believe me, that's too
difficult for them.

If there's no solution, then in the alternative, is there
a way to manipulate Word VBA within the following type
code to do the operations below (p.s., I'm using
Redemption - too lazy to set it back to without):

Code:

sSubject = "New User Setup"
sBody = "Please find attached the requisite detail form
for a new employee/computer."
sFileName = "c:\NewUser\NewUser.doc"

Set SafeItem = CreateObject("ZivCom.SafeMailItem")
Set oItem = objOutlook.CreateItem(olMailItem)
oItem.Attachments.Add sFileName

SafeItem.Item = oItem
SafeItem.Recipients.Add "(e-mail address removed)"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = sSubject
SafeItem.Body = sBody
SafeItem.Send

Needs:

1. Mail recipient the current document on the scree so
that it appears in the email message but is not a physical
attachment (i.e., first selection on the File, Send To
menu);

2. Set options as follows:

a. Use voting buttons;

b. Set the message to high importance

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top