Not able to get items from Outlook Inbox from Windows Service using VB.NET

I have a Windows Service which is setup and running 
properly, well, at least it execute my RunThrougInbox 
method when it is supposed to be. The problem I am having 
though is that when my RunThroughInbox method is 
executing, it seems to stop when it gets to the "PROBLEM 
ON THIS NEXT LINE:" line. I am writing each step of the 
way to the event viewer window and my logs are 
mysteriously stopping. Does anyone have any suggestions? 
Thanks

Here is a portion of my code to help with any resolutions 
or ideas.



Protected Overrides Sub OnStart(ByVal args() As String)
  Dim cbTimer As New Timer(New TimerCallback(AddressOf 
RunThroughInbox), Nothing, 1000, 60000)
End Sub

    Sub RunThroughInbox(ByVal state As Object)


        WriteToEventLog("In the RunThroughInbox Method")

        Try
            '----------------------------------------------
-----
            ' Instantiate Outlook and access the MAPI 
Namespace
            ' (Messaging Application Programming Interface)
            '----------------------------------------------
-----
            Dim olApp As Outlook.Application = New 
Outlook.Application
            WriteToEventLog("passed olApp")

            Dim olNS As Outlook.NameSpace = 
olApp.GetNamespace("MAPI")
            WriteToEventLog("passed olNS")
            '----------------------------------------------
-----
            ' Once we have the MAPI namespace, we can now 
access
            ' the Inbox, which we will grab the email 
messages
            ' from and do further processing.
            '----------------------------------------------
-----

*************************************
PROBLEM ON THIS NEXT LINE:
*************************************

            Dim olInbox As Outlook.MAPIFolder = 
olNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox)

            WriteToEventLog("Passed olInbox: " & 
olInbox.UnReadItemCount.ToString & " :: FolderPath is " & 
olInbox.FolderPath.ToString)


            '----------------------------------------------
-----
            ' Before performing any actions, we must 
provide 
            ' default credentials to access the MAPI.
            '----------------------------------------------
-----
            olNS.Logon("Brian Gaines", "password", False, 
True)

            WriteToEventLog("Logged in under Brian Gaines 
profile.")

            '----------------------------------------------
-----
            ' Get all items in the Inbox to be processed. 
We 
            ' also obtain the number of items in the inbox 
folder
            '----------------------------------------------
-----
            Dim olItems As Outlook.Items = olInbox.Items
            Dim boxCount As Integer = olItems.Count
            Dim i As Integer
            Dim cnt As Integer = 0

            WriteToEventLog("Number of items in Brian 
Gaines inbox are " & boxCount.ToString)

            Try

                '------------------------------------------
---------
                ' We step through our inbox backwards in 
order to 
                ' reference the correct index of the mail 
item. If 
                ' not, then we face the probability of 
deleting 
                ' incorrect emails and stepping out of 
bounds of our
                ' items collection.
                '------------------------------------------
---------
                For i = boxCount To 1 Step -1

                    WriteToEventLog("Inbox Item #" & 
i.ToString)

                    If TypeOf (olItems.Item(i)) Is 
Outlook.ReportItem Then

                        cnt += 1

                        WriteToEventLog("Report Inbox Item 
#" & cnt.ToString)

                        Dim emailSubject As String = 
olItems.Item(i).Subject
                        Dim receiptBody As String = 
olItems.Item(i).Body

                        Dim report As Outlook.ReportItem = 
CType(olItems.Item(i), Outlook.ReportItem)
                        Dim returnedEmail As 
Outlook.Attachment = report.Attachments.Item(1)

                        Dim path As String
                        If _path = "" Then
                            path = GetAppSetting
("TempInboxMsgAttchPath") & TEMP_ATTACHMENT_PREFIX
                        Else
                            path = _path
                        End If

                        returnedEmail.SaveAsFile(path & i 
& TEMP_ATTACHMENT_EXT)

                        Dim err As String = ""
                        Dim emailBody = GetMessageBody
(path & i & TEMP_ATTACHMENT_EXT, err)

                        If err = "" Then

                            '------------------------------
--------------------------
                            ' Regular expression returns 
the invalid email from
                            ' the invalid mail message and 
the mail message guid
                            '------------------------------
--------------------------
                            Dim invalidEmail As String = 
RegExValue(emailBody, GetAppSetting("EmailRegExChecker"))
                            Dim matchGuid As String = 
RegExValue(emailBody, GetAppSetting("GuidRegExChecker"))
                            Dim writeGuidMessage As String 
= ""
                            If matchGuid <> "" Then
                                writeGuidMessage = " for 
GUID " & matchGuid & " "
                            End If
                            Console.Write(FormatDateTime
(Now) & ": Email to " & invalidEmail & writeGuidMessage 
& " was processed.")

                            File.Delete(path & i & 
TEMP_ATTACHMENT_EXT)

                            '------------------------------
--------------------------
                            ' We remove this undeliverable 
mail message from our
                            ' Inbox folder and move on to 
the next email item.
                            '------------------------------
--------------------------
                            olItems.Item(i).Delete()
                        Else
                            WriteToEventLog(err.ToString)
                            Exit Sub
                        End If
                    End If

                Next i

                WriteToEventLog("Done with Inbox")

            Catch ex As Exception
                WriteToEventLog(ex.ToString)
            Finally

                '------------------------------------------
--------------
                ' We now close our session with MAPI as 
well as Outlook
                '------------------------------------------
--------------
                olNS.Logoff()
                olApp.Quit()

                WriteToEventLog("Logged and quit Outlook")

                '------------------------------------------
--------------
                ' We de-reference any memory allocation to 
these objects
                '------------------------------------------
--------------
                olApp = Nothing
                olNS = Nothing
                olItems = Nothing
                olInbox = Nothing
                WriteToEventLog(cnt & " Emails were 
processed.")
            End Try

        Catch outEx As Exception
            WriteToEventLog(outEx.ToString)
        End Try

    End Sub 
0
bgaines (1)
1/12/2004 6:36:09 PM
outlook 87535 articles. 11 followers. Follow

1 Replies
598 Views

Similar Articles

[PageSpeed] 49

Outlook is not suitable for running in a Windows service. You will
have problems if you attempt to do so.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Brian" <bgaines@nfa.futures.org> wrote in message
news:049201c3d93a$f2305450$a101280a@phx.gbl...
> I have a Windows Service which is setup and running
> properly, well, at least it execute my RunThrougInbox
> method when it is supposed to be. The problem I am having
> though is that when my RunThroughInbox method is
> executing, it seems to stop when it gets to the "PROBLEM
> ON THIS NEXT LINE:" line. I am writing each step of the
> way to the event viewer window and my logs are
> mysteriously stopping. Does anyone have any suggestions?
> Thanks
>
> Here is a portion of my code to help with any resolutions
> or ideas.
>
>
>
> Protected Overrides Sub OnStart(ByVal args() As String)
>   Dim cbTimer As New Timer(New TimerCallback(AddressOf
> RunThroughInbox), Nothing, 1000, 60000)
> End Sub
>
>     Sub RunThroughInbox(ByVal state As Object)
>
>
>         WriteToEventLog("In the RunThroughInbox Method")
>
>         Try
>             '----------------------------------------------
> -----
>             ' Instantiate Outlook and access the MAPI
> Namespace
>             ' (Messaging Application Programming Interface)
>             '----------------------------------------------
> -----
>             Dim olApp As Outlook.Application = New
> Outlook.Application
>             WriteToEventLog("passed olApp")
>
>             Dim olNS As Outlook.NameSpace =
> olApp.GetNamespace("MAPI")
>             WriteToEventLog("passed olNS")
>             '----------------------------------------------
> -----
>             ' Once we have the MAPI namespace, we can now
> access
>             ' the Inbox, which we will grab the email
> messages
>             ' from and do further processing.
>             '----------------------------------------------
> -----
>
> *************************************
> PROBLEM ON THIS NEXT LINE:
> *************************************
>
>             Dim olInbox As Outlook.MAPIFolder =
> olNS.GetDefaultFolder
> (Outlook.OlDefaultFolders.olFolderInbox)
>
>             WriteToEventLog("Passed olInbox: " &
> olInbox.UnReadItemCount.ToString & " :: FolderPath is " &
> olInbox.FolderPath.ToString)
>
>
>             '----------------------------------------------
> -----
>             ' Before performing any actions, we must
> provide
>             ' default credentials to access the MAPI.
>             '----------------------------------------------
> -----
>             olNS.Logon("Brian Gaines", "password", False,
> True)
>
>             WriteToEventLog("Logged in under Brian Gaines
> profile.")
>
>             '----------------------------------------------
> -----
>             ' Get all items in the Inbox to be processed.
> We
>             ' also obtain the number of items in the inbox
> folder
>             '----------------------------------------------
> -----
>             Dim olItems As Outlook.Items = olInbox.Items
>             Dim boxCount As Integer = olItems.Count
>             Dim i As Integer
>             Dim cnt As Integer = 0
>
>             WriteToEventLog("Number of items in Brian
> Gaines inbox are " & boxCount.ToString)
>
>             Try
>
>                 '------------------------------------------
> ---------
>                 ' We step through our inbox backwards in
> order to
>                 ' reference the correct index of the mail
> item. If
>                 ' not, then we face the probability of
> deleting
>                 ' incorrect emails and stepping out of
> bounds of our
>                 ' items collection.
>                 '------------------------------------------
> ---------
>                 For i = boxCount To 1 Step -1
>
>                     WriteToEventLog("Inbox Item #" &
> i.ToString)
>
>                     If TypeOf (olItems.Item(i)) Is
> Outlook.ReportItem Then
>
>                         cnt += 1
>
>                         WriteToEventLog("Report Inbox Item
> #" & cnt.ToString)
>
>                         Dim emailSubject As String =
> olItems.Item(i).Subject
>                         Dim receiptBody As String =
> olItems.Item(i).Body
>
>                         Dim report As Outlook.ReportItem =
> CType(olItems.Item(i), Outlook.ReportItem)
>                         Dim returnedEmail As
> Outlook.Attachment = report.Attachments.Item(1)
>
>                         Dim path As String
>                         If _path = "" Then
>                             path = GetAppSetting
> ("TempInboxMsgAttchPath") & TEMP_ATTACHMENT_PREFIX
>                         Else
>                             path = _path
>                         End If
>
>                         returnedEmail.SaveAsFile(path & i
> & TEMP_ATTACHMENT_EXT)
>
>                         Dim err As String = ""
>                         Dim emailBody = GetMessageBody
> (path & i & TEMP_ATTACHMENT_EXT, err)
>
>                         If err = "" Then
>
>                             '------------------------------
> --------------------------
>                             ' Regular expression returns
> the invalid email from
>                             ' the invalid mail message and
> the mail message guid
>                             '------------------------------
> --------------------------
>                             Dim invalidEmail As String =
> RegExValue(emailBody, GetAppSetting("EmailRegExChecker"))
>                             Dim matchGuid As String =
> RegExValue(emailBody, GetAppSetting("GuidRegExChecker"))
>                             Dim writeGuidMessage As String
> = ""
>                             If matchGuid <> "" Then
>                                 writeGuidMessage = " for
> GUID " & matchGuid & " "
>                             End If
>                             Console.Write(FormatDateTime
> (Now) & ": Email to " & invalidEmail & writeGuidMessage
> & " was processed.")
>
>                             File.Delete(path & i &
> TEMP_ATTACHMENT_EXT)
>
>                             '------------------------------
> --------------------------
>                             ' We remove this undeliverable
> mail message from our
>                             ' Inbox folder and move on to
> the next email item.
>                             '------------------------------
> --------------------------
>                             olItems.Item(i).Delete()
>                         Else
>                             WriteToEventLog(err.ToString)
>                             Exit Sub
>                         End If
>                     End If
>
>                 Next i
>
>                 WriteToEventLog("Done with Inbox")
>
>             Catch ex As Exception
>                 WriteToEventLog(ex.ToString)
>             Finally
>
>                 '------------------------------------------
> --------------
>                 ' We now close our session with MAPI as
> well as Outlook
>                 '------------------------------------------
> --------------
>                 olNS.Logoff()
>                 olApp.Quit()
>
>                 WriteToEventLog("Logged and quit Outlook")
>
>                 '------------------------------------------
> --------------
>                 ' We de-reference any memory allocation to
> these objects
>                 '------------------------------------------
> --------------
>                 olApp = Nothing
>                 olNS = Nothing
>                 olItems = Nothing
>                 olInbox = Nothing
>                 WriteToEventLog(cnt & " Emails were
> processed.")
>             End Try
>
>         Catch outEx As Exception
>             WriteToEventLog(outEx.ToString)
>         End Try
>
>     End Sub


0
kenslovak (742)
1/12/2004 8:24:36 PM
Reply:

Similar Artilces:

Using Relative path for XML data file?
Is there a way to specify a relative path to an XML data file imported into Excel 2003? I am writing a web app that generates report data as XML for the user to download to their local machine. This data is to be consumed by an Excel reporting spreadsheet, which contains display-formatted tables and charts that are mapped to various data fields in an XML Map, which is in turn linked to the xml data file they will download. The idea is the user only needs to download the data for updates, not the whole spreadsheet. However, since I cannot predict the path where the user will store their...

From Outlook 2000 to Outllook 2003
How do I migrate I personal folders file (.pst) from Outlook 2000 to Outlook 2003? Read the Help Files: http://office.microsoft.com/en-us/assistance/HA010771141033.aspx -- Russ Valentine [MVP-Outlook] "rolo" <rolo@discussions.microsoft.com> wrote in message news:706405A0-2971-409F-B213-67714B12713C@microsoft.com... > How do I migrate I personal folders file (.pst) from Outlook 2000 to > Outlook > 2003? Thanks Russ it helped. By the way how can I get to this useful help files? "Russ Valentine [MVP-Outlook]" wrote: > Read the Help Files: > htt...

Moving from Outlook Express to Outlook
How do you transfer files from OE to Outlook - inbox, contacts, etc. Can you do so if you have already started using Outlook but want to bring these files over. cooker <anonymous@discussions.microsoft.com> wrote: > How do you transfer files from OE to Outlook - inbox, contacts, etc. > Can you do so if you have already started using Outlook but want to > bring these files over. Start Outlook Express, click File>Export>Messages. If you have Outlook running at the same time, you'll see the messages appear in Outlook. -- Brian Tillman Smiths Aerospace 3290 Patterson ...

Problem with "Use Unicode Format when saving messages"
In outlook we have option to set "use Unicode format when saving messages"(outlook>tools>options>other >Advanced options),even though option is enabled, when ever I try "save as" the email into folder, it is showing Html format by default.However can drop down the list and select the Unicode format. But I need Unicode message format to be shown by default if I need to "save as" any email. Any Suggestion ? Regards, Sam That is not possible and that is not what this option controls. The option controls whether the default safe fo...

Formula without using numbers after decimal in the answer
I have a formula that derives the answer from a figure with a decimal. I don't want to use the figures after the decimal. Is there a way to just use the whole number and omit the numbers after the decimal without having to manually key in all these numbers manually? Thanks, Mustang You can use the INT function. This 'rounds down' any number to th nearest integer, e.g. if A1=2.567, a formula in B2 of =INT(A1) return 2 HTH Bruc -- swatsp0 ----------------------------------------------------------------------- swatsp0p's Profile: http://www.excelforum.com/member.php?...

Outlook 0x800ccc0d error when Norton e-mail protect enabled: see hosts
This post is made to help others solve this issue, based on my experience. Symptom: - Outlook works perfectly well when Norton Anti-Virus e-mail protection is disabled - Outlook cannot retrieve incoming messages when NAV e-mail protection is enabled, message being: pop3 server not found, error 0x800ccc0d This symptom, and possible solutions, are exactly the object of Symantec support note: http://service1.symantec.com/SUPPORT/nav.nsf/docid/2000020716064206 Please read this note first ! The object of this post is to add another possible solution to this problem. NAV email protection sets up...

POST or GET?
(apologies if this is OT but I couldn't find an HTTP newsgroup) I am writing an MFC client application which speaks to an HTTP server. The server will send text data to the client, the client will modify and return that data to the server along with a small amount of new data. Should I use GET or POST to get the data from the server? "Richard" <richard@hello.com> wrote in message news:zWudf.14758$Cq4.8824@newsfe7-gui.ntli.net... > I am writing an MFC client application which speaks to an HTTP server. The > server will send text data to the client, the client...

Outlook Sales
I have installed the CRM Server,Outlook Router, SQL, the whole nine yards so to say. So now when I try to install the Sales for Outlook CD, it gets to "Initializing" and then crashes with an error message that is unknown. Here is the message; Product: Microsoft CRM Sales for Outlook -- Installation operation failed. The Event ID is 11708, any help would be appreciated. It is running on WIN2000 Server with Dual Xeon 3.06 with 2GB of Ram. Thanks, Bobby Bobby You cannot install the outlook client on the same machine as the MSCRM server - that's probably why it's bomb...

Outlook 2002 (office xp developer suite)
Does anyone know of a place where I can find a bunch of various macros for outlook? I've looked around and found 1 or 2 but I would think someone has a large amount of them.. Thanks Dave dave wrote: > Does anyone know of a place where I can find a bunch of > various macros for outlook? I've looked around and found > 1 or 2 but I would think someone has a large amount of > them.. > > Thanks > > Dave Dunno, but a Google search on "Outlook macros" gets about 55,000 hits.... G'Day Dave, Try: http://www.outlookvba.com/examples//allexamples...

Cannot open Outlook, keep getting Send error report of Microsoft.
We are having problems with Outlook 2003. Everytime we try to open, we get this: Send error report to Microsoft. Any ideas why? All windows and office update have been completed. ...

How do I see when new messages without outlook running?
Without Outlook 2003 constantly running, how do I send mail or know when I have new mail? two possible answers... 1) you don't or 2) you acquired a 3rd party app to occasionally poll your pop3/imap account "Leslie Adams" <Leslie Adams@discussions.microsoft.com> wrote in message news:D37C11C7-722C-4E91-9393-735A49C11701@microsoft.com... > Without Outlook 2003 constantly running, how do I send mail or know when I > have new mail? ...

setup Windows Mail as Word 2003 default emailer
All I can do is setup Outlook. I do not use Outlook. I would like to email Word docs using MS Windows Mail (new version of Express) In the Windows Start area, type Regedit into the search bar and then start the Registry Editor and go to HKEY_CURRENT_USER>Software>Clients>Mail Right Click on the (Default) item and then on Modify and in the Value data: field enter Windows Mail so that after you click OK, you have (Default) REG_SZ WIndows Mail -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a pa...

Outlook 2003 Drag and Drop Emails
I have an issue where there is a SBS 2003 server (newly installed) & when I drag emails to the file system (explorer window) in order to create file records of the emails it generates an error. Dialog Box Name: Error Copying File or Folder Error Msg: Not enough storage is available to process this command. I can't find an error logged anywhere, either on the server event logs or on the local machine event logs... I have searched the MS KB & Office online, but no joy yet... If anyone can help that would be great!!! R ...

using the journal on outlook
Once I link an email to the journal, can I still find that email in my mail box? I seem to be able to get to it only via the journal. If this is the way it is supposed to be, how do I remove it from the journal and get it back into my mail box? Am I just missing something? -- thanks, Independent Are you linking to the item or putting a copy into the journal item? Also, has the item been archived or not? "Independent" <Independent@discussions.microsoft.com> wrote in message news:868279F2-53C8-403A-97F5-604CEECD873C@microsoft.com... > Once I link an email to the journ...

how to find an item in a list control?
hi all, In a list Control how to find an item. If it is found then the item should be highlighted. how to do this? i wrote the following code but its not working what's wrong in the code? LVFINDINFO info; int nIndex; info.flags = LVFI_PARTIAL|LVFI_STRING; info.psz = (LPCTSTR) str; //fd.m_strEditCtrl; sprintf(st,"%d",m_ListCtrl.GetItemCount()); MessageBox(st,"Count"); for(int i=0;i < m_ListCtrl.GetItemCount();i++) { if((nIndex = m_ListCtrl.FindItem(&info,-1)) == -1 ) { m_ListCtrl.SetItemState(nIndex,LVIS_SELECTED,LVIS_SELECTED); } } thanks and r...

Is anyone an expert with outlook that I can call on the phone?
How do I share calenders between outlook and my MSN Premier account? Assuming you are using the outlook connector, you need to set the msn account to be the default message store then outlook will use the msn calendar as the default. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM You can access this...

cannot open hyper links in outlook
when I try to open a hyperlink in outlook, I get the following message: This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator. ----- I am the system administrator. HELP This is a problem with IE, not Outlook. You need to reset your internet settings in IE's Tools, Internet Options, Advanced tab. (Or Control Panel, Internet options, Advanced tab). See http://www.slipstick.com/problems/link_restrict.htm for more information. "Donald McNeely" <Donald McNeely@discussions.microsoft.com>...

Stop Outlook from starting up automatically
Once I installed Outlook2003, it now runs automatically on startup. How do I disable this? -- | +-- Julian | are you using a PDA that is trying to access the data in it? If so, make sure the device is not connected when you boot. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscribe to Exchange Messaging Outlook ne...

outlook 97 and express email problems
Hi, I am currently on an IBM X21 laptop and is running windows 98 se with office 97 pro. I recently experienced some problems with outlook (illegal operations etc) and reinstalled office to fix the problem but since then I have not been able to send or recieve emails with outlook 97 and outlook express 6. I simply get an error message saying the host can't be found (but does exist and I can ping it successfully). Any suggestions on what I might do? I have tried creating new accounts in windows mail and outlook express, but I still get the same error. Thankyou in advance! Tim D...

get a result of an sql into a field
Hi there I would like to get a result of an sql execution (ms sql server) into aq filed. example i A1 I have a ID number in A2 I would like to get the result of something like this 'select name from address where id=A1' Does this exist in Excel ? Thanks in advance Ralf Here is the sub i have written for loading an Sql Query into th worksheet. Parameters: Server Name DataBase Name SQL Command Target Sheet name Column to begin from Row to begin from ex: CALL LoadData("MyServer","MyDataBase","Select UserName fro TblNames", "QueryData"...

unable to paste Excel 2003 chart into Outlook 2003
(This was posted on "excel.charting" group.) I have a user who's unable to paste an Excel 2003 chart into Outlook 2003 email message. In Outlook options, the checkbox is selected for "Use Microsoft Office Word 2003 to edit e-mail messages". When I tested this on my own computer running the same version of Office, if the box is check, I have no problem pasting; if this box is cleared, I cannot paste. But on his computer, it doesn't work regardless. Thanks and regards, TL ...

Disable Secure Sockets Layer on exchange server when using RPC over HTTP
Hi im trying to enable RPC over HTTP to enable users to establish contact to my Excahger server 2003 over the internet. Now, I dont want to use SSL (security not that important) and i am told by this article that i can disable SSL in windows registry. Quote: Note While RPC over HTTP does not require Secure Sockets Layer, you must modify the registry to enable RPC over HTTP if you do not want to use Secure Sockets Layer. Microsoft recommends that you enable and require Secure Sockets Layer for your RPC over HTTP communications. At this address: http://support.microsoft.com/?id=833401 But i ...

How do you invoke the Let and Get class Functions
I have create classes with the Let and Get functions and now I would like to use these functions to store and retrieve data in the class which will then be put into a collection. Here is the class functions: Private pBusPart As Double Private pStartTime As Date Private pIndex As Integer '''''''''''''''''''''' ' BusPart property '''''''''''''''''''''' Public Property Get BusPart() As Double BusPar...

Test for Windows Classic folders in XP?
Hey, I use GetVersionEx to check for XP, is there a test for Windows Classic folders in XP? Thanks, Wayne Use IsThemeActive(); Get uxtheme.h, uxtheme.lib, and uxtheme.dll by downloading Platform SDK for WIndows XP SP2 from Microsoft. Wayne "Wayne Ransier" <vsense@netcarrier.com> wrote in message news:O49wUd%23IFHA.2648@TK2MSFTNGP14.phx.gbl... > Hey, > > I use GetVersionEx to check for XP, is there a test for Windows Classic > folders in XP? > > Thanks, > Wayne > > ...

How to get to email from Word
Sorry to break the thread, but replying to the original thread now produces an error message :( The suggested changes don't make any difference to the essential premise that it all works as long as Outlook is running in the background. Stepping though the code has provided inconsistent results. It usually crashes at the line strEMail = Application.GetAddress("", strEMail, False, 1, , , True, True) when the address is selected from the dialog and you OK out of the dialog; but I have noticed that this call has produced crashes in other routines where Outlook is not running. Th...