[AccessD] Outlook Object Broken

MartyConnelly martyconnelly at shaw.ca
Tue Jun 29 11:06:45 CDT 2004


One down side of late binding is that you no longer work with 
intellisence...

There are ways to fix intellisence too with conditional compilation to 
keep intellisense for debugging..

#Const DebugVersion = 0

#if DebugVersion = 1 then
   'early binding
    Dim wa as Word.Application
    Set wa = new word.application
#else
   'late binding
    Dim wa as Object
    set wa = createobject ("Word.Application")
#endif

You'l have to set the flag to 1
    (#Const DebugVersion = 1)
and then add a reference to MSWord  for the debug intellisense to work...


vchas wrote:

>Dim objOutlook As Object
>Set objOutlook = CreateObject("Outlook.Application")
>Set objOutlookMsg = objOutlook.CreateItem(0)
>With objOutlookMsg
>   .To = "you at companyname.com"
>   .Cc = "them at companyname.com"
>   .Subject = "Hello World (one more time)..."
>   .Body = "body of message"
>   .HTMLBody = "HTML version of message"
>   .Attachments.Add ("c:\FileToSend.txt")
>   .Send
>End With
>Set objOutlookMsg = Nothing
>Set objOutlook = Nothing
>
>HTH
>
>V
>
>  
>
>>-----Original Message-----
>>From: accessd-bounces at databaseadvisors.com
>>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky 
>>Smolin - Beach Access Software
>>Sent: 28 June 2004 22:21
>>To: Access Developers discussion and problem solving
>>Subject: Re: [AccessD] Outlook Object Broken
>>
>>
>>Doris:
>>
>>I declare the object variables like this:
>>
>>   Dim objOutlook As Outlook.Application
>>   Dim objOutlookMsg As Outlook.MailItem
>>   Dim objOutlookRecip As Outlook.Recipient
>>   Dim objOutlookAttach As Outlook.Attachment
>>
>>Then it blows up on the very next line:
>>
>>   ' Create the Outlook session.
>>   Set objOutlook = CreateObject("Outlook.Application")
>>
>>So I'm not referencing the specific Outlook 9.0 library.  Is it 
>>possible that they changed the names of the properties or methods or 
>>whatever you call them in the Outlook 11 library - like changing 
>>.Application to .App or some other humorous trick to keep us fully 
>>employed?
>>
>>TIA
>>
>>is
>>
>>----- Original Message -----
>>From: "Mike & Doris Manning" <mikedorism at adelphia.net>
>>To: "'Access Developers discussion and problem solving'" 
>><accessd at databaseadvisors.com>
>>Sent: Monday, June 28, 2004 1:11 PM
>>Subject: RE: [AccessD] Outlook Object Broken
>>
>>
>>    
>>
>>>We ran into a similar problem because we have many
>>>      
>>>
>>different operating
>>    
>>
>>>systems in our organization.  We got around it by not referencing a 
>>>particular Outlook object model.
>>>
>>>Doris Manning
>>>Database Administrator
>>>Hargrove Inc.
>>>www.hargroveinc.com
>>>
>>>
>>>-----Original Message-----
>>>From: accessd-bounces at databaseadvisors.com
>>>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky 
>>>Smolin - Beach Access Software
>>>Sent: Monday, June 28, 2004 1:16 PM
>>>To: AccessD at databaseadvisors.com
>>>Subject: [AccessD] Outlook Object Broken
>>>
>>>
>>>Dear List:
>>>
>>>I provide an app to a client which uses the Outlook object to send 
>>>emails. In my version the reference is to the Microsoft Outlook 9.0 
>>>Object
>>>      
>>>
>>Library.
>>    
>>
>>>They recently upgraded to A2003 and their reference is now to the
>>>      
>>>
>>Microsoft
>>    
>>
>>>Outlook 11.0 Object Library.
>>>
>>>When my app hits the line of code:Set objOutlook =
>>>CreateObject("Outlook.Application")  it blows up saying it
>>>      
>>>
>>is unable
>>    
>>
>>>to create the object.
>>>
>>>Is there an easy fix or workaround to this problem?
>>>
>>>MTIA,
>>>
>>>Rocky Smolin
>>>Beach Access Software
>>>http://www.e-z-mrp.com
>>>
>>>--
>>>_______________________________________________
>>>AccessD mailing list
>>>AccessD at databaseadvisors.com
>>>http://databaseadvisors.com/mailman/listinfo/accessd
>>>Website: http://www.databaseadvisors.com
>>>
>>>--
>>>_______________________________________________
>>>AccessD mailing list
>>>AccessD at databaseadvisors.com
>>>http://databaseadvisors.com/mailman/listinfo/accessd
>>>Website: http://www.databaseadvisors.com
>>>
>>>      
>>>
>>--
>>_______________________________________________
>>AccessD mailing list
>>AccessD at databaseadvisors.com
>>http://databaseadvisors.com/mailman/listinfo/accessd
>>Website: http://www.databaseadvisors.com
>>
>>
>>    
>>
>
>--
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list