Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternative to Office Assistant in 2007?
Message
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01376566
Message ID:
01376582
Views:
16
>I want to notify the user that certain interactive features of Word (Save and Print) are disabled and will be controlled by the VFP application. The Office Assitant has apparently been removed from Word 2007. Is there another way to send a message to the user from Word?
>
>The message can come from VFP but would look much more professional if were directly from Word.

You can use DoAlert method (Messagebox)
PUBLIC oWord
oWord = CREATEOBJECT("Word.Application")
oWord.Visible = .T.

oWord.Assistant.DoAlert("Alert Title", "Alert Text",0,4,0,-1,0)

TEXT NOSHOW

-- 1 --
-- 2 --

-- 3 --
Specifies the buttons to be displayed when issuing an alert to the user with the DoAlert method of the Assistant object.
Name Value Description 
msoAlertButtonAbortRetryIgnore 2 Abort, Retry, and Ignore buttons. 
msoAlertButtonOK 0 OK button. 
msoAlertButtonOKCancel 1 OK and Cancel buttons. 
msoAlertButtonRetryCancel 5 Retry and Cancel buttons. 
msoAlertButtonYesAllNoCancel 6 Yes, Yes to All, No, and Cancel buttons. 
Can only be used if the varSysAlert argument of the DoAlert method is set to False. 
msoAlertButtonYesNo 4 Yes and No buttons. 
msoAlertButtonYesNoCancel 3 Yes, No, and Cancel buttons. 

-- 4 --
Specifies which icon, if any, to display with an alert. 
Name Value Description 
msoAlertIconCritical 1 Displays the Critical icon. 
msoAlertIconInfo 4 Displays the Info icon. 
msoAlertIconNoIcon 0 Displays no icon with the alert message. 
msoAlertIconQuery 2 Displays the Query icon. 
msoAlertIconWarning 3 Displays the Warning icon. 

-- 5 --

Specifies which button is set as the default when calling the DoAlert method of the Assistant object.
Name Value Description 
msoAlertDefaultFifth 4 Default to fifth button. 
msoAlertDefaultFirst 0 Default to first button. 
msoAlertDefaultFourth 3 Default to fourth button. 
msoAlertDefaultSecond 1 Default to second button. 
msoAlertDefaultThird 2 Default to third button. 


-- 6 --
Specifies behavior when the user cancels an alert. Only msoAlertCancelDefault is currently supported.
Name Value Description 
msoAlertCancelDefault -1 Default behavior for canceling an alert. 
msoAlertCancelFifth 4 Not supported. 
msoAlertCancelFirst 0 Not supported. 
msoAlertCancelFourth 3 Not supported. 
msoAlertCancelSecond 1 Not supported. 
msoAlertCancelThird 2 Not supported 

--------------------------------------------


DoAlert Parameters

Name Required/Optional Data Type Description 
bstrAlertTitle Required String Sets the title of the alert. 
bstrAlertText Required String Sets the text of the alert. 
alb Required MsoAlertButtonType Determines which buttons are displayed on the alert. 
alc Required MsoAlertIconType Determines the icon that is displayed on the alert. 
ald Required MsoAlertDefaultType Determines which button is set as the default button of the alert. 
If this argument is set to a value greater than the number of buttons, an error is returned. 
alq Required MsoAlertCancelType Always set this to msoAlertCancelDefault. 
Any other setting may return an error. 
varfSysAlert Required Boolean. Ignored in Word 2007. 

ENDTEXT
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform