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?
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.
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.
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
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.
Since I discovered Delphi and Lazarus, VB has become history to me.
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Re: [RESOLVED] Is VB6 compatible with Office 2007?
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.
Since I discovered Delphi and Lazarus, VB has become history to me.
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