Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHere's what I did... Pin
Fredrik18-Sep-00 22:50
Fredrik18-Sep-00 22:50 
GeneralRe: Here's what I did... Pin
Roger19-Sep-00 2:17
Roger19-Sep-00 2:17 
GeneralBitmap in a status bar pane Pin
#realJSOP18-Sep-00 3:51
professional#realJSOP18-Sep-00 3:51 
Generalspawning exe file from another exe file Pin
Hamid Yousaf18-Sep-00 1:52
Hamid Yousaf18-Sep-00 1:52 
GeneralRe: spawning exe file from another exe file Pin
Dark Angel18-Sep-00 4:38
Dark Angel18-Sep-00 4:38 
GeneralGet the coordinates of the AppBar Pin
Eq18-Sep-00 0:55
Eq18-Sep-00 0:55 
GeneralRe: Get the coordinates of the AppBar Pin
Michael Dunn18-Sep-00 7:18
sitebuilderMichael Dunn18-Sep-00 7:18 
GeneralError in running Script control Pin
Reny j joseph thuthikattu17-Sep-00 21:37
Reny j joseph thuthikattu17-Sep-00 21:37 
Hi there,
I tried this site to access the mail object form
the outlook from my
VC ++ using the script control.
But it is giving some error.
The code is ***
#import "C:\Program Files\Microsoft Script Control
\msscript.ocx"

using namespace MSScriptControl;

IScriptControlPtr
spScriptCtl(__uuidof(ScriptControl));

spScriptCtl->put_Language(bstrLanguage);

spScriptCtl->AddCode("Sub Test1\nSet myOlApp ="
"CreateObject\"Outlook.Application\"\n"
"MsgBox \"Hello World\"\n"
"Set nsMAPI = myOlApp.GetNameSpace\"MAPI\"\n"
"Set objInbox = nsMAPI.GetDefaultFolder\"6\"\n"
"i = 1\n"
"While i <= objInbox.Items.Count\n"
"Set objMail = objInbox.Items\" i \"\n"
"If objMail = \"Gimme ur contac........\" Then\n"
"MsgBox \"Hello World Before\"\n"
"End If\n"
"i = i + 1\n"
"Wend \nEnd Sub");
spScriptCtl->ExecuteStatement("Test1");

Sub MSOff()
'DESCRIPTION: A description was not provided.

'TODO: Put macro code here


'Create the Session Object
Set myOlApp = CreateObject("Outlook.Application")
Set nsMAPI = myOlApp.GetNameSpace("MAPI")
Set objInbox = nsMAPI.GetDefaultFolder(6)

i = 1
While i <= objInbox.Items.Count
Set objMail = objInbox.Items(i)
' check the name of the letter
If objMail = "RE: CST13598207ID - help" Then
' do stuff with objMail (like access contents) -
' see Outlook documentation for things you can
do...
End If
i = i + 1
Wend
End Sub
It is not showing error while icomiling.But it is
not even executing the "Test" method.The reason
why i telling is it is nit showing the Message Box
"Hello World Before". So what may be the reason
for not executing the Test method script.
Another problem is in the line
nsMAPI.GetDefaultFolder(6) .But in the macro i
write it as nsMAPI.GetDefaultFolder\"6\"\n". ANd
how can i write nsMAPI.GetDefaultFolder(6) there.I
want to get the message body if the message
matches the same.


Please help me out
Expecting your reply
Reny
GeneralVC++ conversion urgent Pin
Guruprasad17-Sep-00 18:05
Guruprasad17-Sep-00 18:05 
GeneralRe: VC++ conversion urgent Pin
Dark Angel18-Sep-00 4:34
Dark Angel18-Sep-00 4:34 
GeneralUsing 256 color icons in CTreeCtrl Pin
Mustafa Demirhan16-Sep-00 23:45
Mustafa Demirhan16-Sep-00 23:45 
GeneralSystem Tray Pin
kennan16-Sep-00 23:07
kennan16-Sep-00 23:07 
GeneralRe: System Tray Pin
Mustafa Demirhan16-Sep-00 23:27
Mustafa Demirhan16-Sep-00 23:27 
GeneralRe: System Tray Pin
Mustafa Demirhan16-Sep-00 23:30
Mustafa Demirhan16-Sep-00 23:30 
GeneralRe: System Tray Pin
Sam Hobbs17-Sep-00 19:45
Sam Hobbs17-Sep-00 19:45 
GeneralMFC, API Pin
kennan16-Sep-00 22:06
kennan16-Sep-00 22:06 
GeneralRe: MFC, API Pin
Paolo Messina16-Sep-00 22:48
professionalPaolo Messina16-Sep-00 22:48 
GeneralProblem with getting file and line from ImageHlp.dll Pin
Stephen Kellett16-Sep-00 5:31
Stephen Kellett16-Sep-00 5:31 
GeneralRe: Problem with getting file and line from ImageHlp.dll Pin
Gert Boddaert18-Sep-00 1:58
Gert Boddaert18-Sep-00 1:58 
GeneralRe: Problem with getting file and line from ImageHlp.dll Pin
Stephen Kellett26-Sep-00 2:08
Stephen Kellett26-Sep-00 2:08 
GeneralRe: Problem with getting file and line from ImageHlp.dll Pin
Gert Boddaert26-Sep-00 2:29
Gert Boddaert26-Sep-00 2:29 
GeneralProblems with Platform SDK Pin
Stephen Kellett16-Sep-00 5:26
Stephen Kellett16-Sep-00 5:26 
GeneralRe: Problems with Platform SDK Pin
mg29-Sep-00 6:45
mg29-Sep-00 6:45 
GeneralTransparentBlt Pin
David15-Sep-00 18:41
David15-Sep-00 18:41 
GeneralDialog resolution Pin
Roger15-Sep-00 7:40
Roger15-Sep-00 7:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.