Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting Object Library references that are backwards compatible 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
hi,

We have a problem with different staff having different versions of Office.

I'm trying to wrap up our access DB with MSA2010 runtime, only it keeps replacing the references for Word / Outlook from 2003 to 2010.

Is there a way of keeping the references to the old versions of word/outlook while delveloping the access DB in MSO 2010?

I was wondering if you could code these references in VBA rather than using the Access IDE and 'references' menu option?

Thanks,
1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
The standard ways are to either develop with the oldest version or to use late binding (ie NO references).

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
thanks PHV, can you advise or point me to late binding info for word/outlook/excel.

I'm asuming this is something that will affect every where I try to use word / outlook and excel and I will need to code it differently?

Developing in the older version is not an option, as i can't get the runtime for 2003 which is in VSTO 2005, which I don't have nor can I find it on ebay or amazon :-(

Your advise and help in this matter is really appreciated.

1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
any idea how i declare and late bind the following?

Code:
    Dim l_Msg As Outlook.MailItem
    Dim colAttach As Outlook.Attachments
    Dim l_Attach As Outlook.Attachment
    Dim oReceipt As Outlook.Recipient
    Dim oPA As Outlook.PropertyAccessor

Thanks.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
1) Get rid of the reference to the Outlook library
2) Use the Option Explicit instruction
3)
Code:
    Dim l_Msg As Object
    Dim colAttach As Object
    Dim l_Attach As Object
    Dim oReceipt As Object
    Dim oPA As Object

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

This is an example I've got from somebody here at Tek-Tips some time ago about early / late Excel bounding:
Code:
[green]    'create Excel Application object early or late bound
    
    '1) Early bound is good for debugging with intellisense 
        'but requires project ref into a specific Excel version 
        'library and makes the vb6 app Excel version dependent
    'Dim xlObj As New Excel.Application
    
    '2) Late bound is not good for debugging but does not 
        'require project ref and vb6 app is not dependent 
        'on specific Excel version[/green]
    Dim xlObj As Object
    Set xlObj = CreateObject("Excel.Application")
    
[green]    'do stuff to it[/green]
    With xlObj
        .Visible = True [green]'if you want to see it[/green]
        'create/ load a WorkBook
        With .Workbooks.Open(App.Path & "\Book1.xls")
[green]            'access a sheet within it[/green]
            With .Sheets(1)
[green]                'do stuff to the sheet[/green]
                If .Cells(1, 1) = "Hello" Then
                    .Cells(1, 1) = "GoodBye"
                Else
                    .Cells(1, 1) = "Hello"
                End If
            End With
            .Save   [green]'the WorkBook[/green]
        End With
        .Quit   [green]'the Application; if you want to[/green]
    End With

Have fun.

---- Andy
 
Yeah, I worked that out PHV.

The problem I now have is all the enumerated types being used!

This late binding is a royal pain the ass!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top