[RESOLVED] Is VB6 compatible with Office 2007?
Hello, I was wondering if VB5/6 is still compatible with the latest version of MS Office, i.e. Office 2007. In other words, I would like to know if it is still possible to reference Word or Excel using the late binding as we could do with Office XP or 2003.
So, do you know if code like the one below (NB: it is only an example and it is incomplete) still works with Office 2007?
VB Code:
MyText = Trim(txtLetter.Text)
WApp.ActiveWindow.Selection.ParagraphFormat.Alignment = 1
WApp.ActiveWindow.Selection.InsertAfter MyText
WApp.ActiveWindow.Selection.InsertParagraphAfter
WApp.ActiveWindow.Selection.Font.Name = "Arial"
WApp.ActiveWindow.Selection.Font.Size = 10
WApp.ActiveWindow.Selection.Font.Bold = True
WApp.ActiveWindow.Selection.EndOf
Thank you in advance.
Re: Is VB6 compatible with Office 2007?
I haven't tried it yet but until now new Office products didn't break compatibility with any of the previous releases. New look, expanded object hierarchy, new functionality... So, I hope it's still the case. :)
I'm planning on testing it in few weeks.
Re: Is VB6 compatible with Office 2007?
Quote:
Originally Posted by RhinoBull
I haven't tried it yet but until now new Office products didn't break compatibility with any of the previous releases. New look, expanded object hierarchy, new functionality... So, I hope it's still the case. :)
I'm planning on testing it in few weeks.
Thanks. Let me know then.
Re: Is VB6 compatible with Office 2007?
OK, I will but may forget since I never susbscribe to threads. :)
You may want to check with Rob - he may've tested it.
Re: Is VB6 compatible with Office 2007?
Apparently there were some issues with the beta version but hopefully they are fixed by now. :)
Re: Is VB6 compatible with Office 2007?
is office 2007 free to download?
Re: Is VB6 compatible with Office 2007?
You must be kidding... Was it ever free? :)
Re: Is VB6 compatible with Office 2007?
Quote:
Originally Posted by RhinoBull
Apparently there were
some issues with the beta version but hopefully they are fixed by now. :)
Good. If it is only a question of a few bugs, I am sure MS will sort them out.
My concern was that MS could abandon VBA and prevent VB6 apps from interacting with Office 2007 to force developers to switch to .NET.
Re: Is VB6 compatible with Office 2007?
Quote:
Originally Posted by esposito
... to force developers to switch to .NET.
That's the general idea but they cannot fully enforce as of yet.
Re: Is VB6 compatible with Office 2007?
Quote:
Originally Posted by Dark Byte
is office 2007 free to download?
You can try it for 60 days:
Try the 2007 Microsoft Office System
Re: Is VB6 compatible with Office 2007?
Yes, on a clean install of Office, even on Vista.
One note though, I wouldnt use WApp.ActiveWindow.Selection for a couple of reasons.
Its dependant upon the desired document being the active one (in cases when the word app has multiple documents opened in it).
Slows down as its more resource intensive.
Change it to something like...
VB Code:
WApp.Documents(1).Content.Font.Name = "Arial" 'Or use the document name instead of the index position
Re: Is VB6 compatible with Office 2007?
Quote:
Originally Posted by RobDog888
Yes, on a clean install of Office, even on Vista.
One note though, I wouldnt use WApp.ActiveWindow.Selection for a couple of reasons.
Its dependant upon the desired document being the active one (in cases when the word app has multiple documents opened in it).
Slows down as its more resource intensive.
Change it to something like...
VB Code:
WApp.Documents(1).Content.Font.Name = "Arial" 'Or use the document name instead of the index position
Thank you very much.
Re: [RESOLVED] Is VB6 compatible with Office 2007?
There are new extensions too. So depending on your app's automation code you will still need to update your code. .docx is the 2007 equilivalent of .doc but for files without any macros/vba code. .docm is for macro enabled documents. .dotx and .dotm also as related to templates. Then add in all the original 97-2003 extensions/file types.
Np, anytime. :)
Re: [RESOLVED] Is VB6 compatible with Office 2007?
Quote:
Originally Posted by RobDog888
There are new extensions too. So depending on your app's automation code you will still need to update your code. .docx is the 2007 equilivalent of .doc but for files without any macros/vba code. .docm is for macro enabled documents. .dotx and .dotm also as related to templates. Then add in all the original 97-2003 extensions/file types.
Np, anytime. :)
So, if I understand well, this means that if you want to work on an existing Word (or Excel) document or you want to save a new one, you can't target a .doc or .xls file.
On the contrary, if you create a document on the fly, without saving it, the (pseudo)code below still works.
VB Code:
Dim WApp As Object
Dim WDoc As Object
Set WApp = CreateObject("Word.Application")
Set WDoc = WApp.Documents.Add
'YOUR CODE GOES HERE
WApp.Visible = True
Please correct me if I am mistaken.
Re: Is VB6 compatible with Office 2007?
I know this has already been settled but I just thought to post this for people.
Office 2007 (like previous versions up to... I wanna say 2000?) come with VBA 6.5
1 Attachment(s)
Re: [RESOLVED] Is VB6 compatible with Office 2007?
Yes, it comes with VBA but its a little newer version.
6.5.1020 vs. the older 6.3