I get the general idea of late-binding but haven't had much practice with it. I'm doing this because some users might have either Word 2003 or Word 2007 installed.
I'd like to know the best way to handle constants with Ms Word, specifically this one:
doc.SaveAs strPath, FileFormat:=word.WdSaveFormat.wdFormatText
and this one:
doc = App.Documents.Open filename:= strPath, Format:= word.wdOpenFormatAuto
I suppose I just figure out the numeric value and use that? I'm only asking because I want to be sure that the solution works on both versions of Ms Word.
Mike375
02-10-2009, 02:36 PM
I use number 8 for this
FileFormat:= _ wdFormatHTML
FileFormat:= _ 8
I just tested all mine by only having the default references. However, you are still stuck with the Microsoft Access 11.
boblarson
02-10-2009, 02:47 PM
Yes, if you are using late binding you need to provide either
1. your own constants which have the correct values
2. or just use the values themselves.
pbaldy
02-10-2009, 02:51 PM
I think you're on the right track. I typically develop with early binding so I can step through the code and find out what the numeric values are. I switch to them and then switch the code to late binding, and I'm good to go. I would certainly use Word 2003 to develop so you don't accidentally use something new to 2007, which would probably fail for 2003 users.
Mike375
02-10-2009, 03:07 PM
What do you do about the Microsoft Access 11 Library.
If made in A2003 and Runtime A 2007 is used I assume it would change to Access 12 but if the person did not have Access then no problem?
What if they have MSOffice Pro and Access 2000 and you can't do it on their computer or an MDE
pbaldy
02-10-2009, 03:24 PM
I have several users with the 2007 runtime running 2000 MDE's, with no problems.
Thanks for the reassurance everyone. I did the number substitution and so far everything looks promising.
Mike375
02-10-2009, 05:03 PM
I have several users with the 2007 runtime running 2000 MDE's, with no problems.
And no allowance needs to be made the different Access Library number.
Distributing this stuff is a bigger deal than making it.:D
pbaldy
02-10-2009, 06:12 PM
The 2007 users are running the same MDE that 2000 runtime users are running, so in my case no changes were made to the library references.
Mike375
02-10-2009, 09:22 PM
The 2007 users are running the same MDE that 2000 runtime users are running, so in my case no changes were made to the library references.
Many thanks for your response