Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constants in Word - Excel
Message
 
 
To
30/04/2002 00:41:04
Nitin Parulekar
New Zealand Software Corp Ltd
Hamilton, New Zealand
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00650747
Message ID:
00650753
Views:
19
Nitin,

There's an article over on my website that lists the constants for Excel97 and Word97. There's also a code fragment there that you can use to extract the constants for yourself. It's under Q&A, General, Article qgen013

There's also some code over on Rick Strahl's website and up on msdn.microsoft.com that show some other ways to do it.

In VFP7 the ObjectBrowser has a lot of the functionality builtin.

Here's a code fragment, that came from an MSDN article that I can no longer find a reference to...
LOCAL oTLB_INFO, oConstants, lcConstantsStr, Obj, member
#DEFINE CRLF CHR(13) + CHR(10)

oTLB_INFO = CREATEOBJECT([tli.typelibinfo])
oTLB_INFO.ContainingFile = (THISFORM.txtolbfile.VALUE)

oConstants = oTLB_INFO.Constants

lcConstantsStr = []
FOR EACH Obj IN oTLB_INFO.Constants
   lcConstantsStr = lcConstantsStr + CRLF + "* " + Obj.Name + CRLF
   FOR EACH member IN Obj.Members
      lcConstantsStr = lcConstantsStr + [#DEFINE ] + ;
         member.NAME + [ ] + ;
         TRANSFORM(member.VALUE) + CRLF
   NEXT member
NEXT Obj
> I need to use Word & Excel Ole Automation in VFP for various reasons. I have been successful in getting certain basics working more by hacking and looking at the VB code generated for test Macros. Yet I need to know where to find the values of the various constants used in the VB examples.
>The VB Reference Help available from within Word or Excel talks about things like WdFormatRTF, WdFormatText etc being part of the parameters in commands like SAVEAS() etc.( Save as RTF or Save Text etc)
>
>Where does one find the values for WdFormatRTF, WdFormatText etc.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform