For Each objView In objViews
If objView.Name=strName
?objView.name
=STRTOFILE(objView.XML,'MyXMLfile') &&the XML suffix generates the XML code file
Endif
Endfor
3. Voila: You've just created your custom Outlook table that EVEN INCLUDES YOUR USER DEFINED FIELDS complete with properties, format(s), etc. in XML.
Note: USER DEFINED FIELDS are practically impossible to write in XML directly. E.g.: This is what MS Outlook generated in XML for "MyUserDefinedField" (a User Defined Field):
<column>
<heading>MyUserDefinedField</heading>
<prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyUserDefinedField</prop>
<type>boolean</type>
<width>36</width>
<style>text-align:center;padding-left:3px</style>
<format>boolicon</format>
<displayformat>3</displayformat>
</column>
4. Next, Open the (temporary) MyXMLfile itself and copy (to the clipboard) all the XML code that was generated by outlook ...via VFP's STRTOFILE(objView.XML,'MyXMLfile') statement. Open notepad and label your XML file as you'd wish: In this example you might label that file "objViewCalendar.XML"
5. Finally, label another program and copy this code into it:
#DEFINE olTableView 0
=SetTableProperties("New Calendar Table View") &&This parameter name is arbitrary
****
FUNCTION SetTableProperties
PARAMETERS strViewName
PUBLIC objViews as Views
PUBLIC objViewCalendar as View
oOutlook = Createobject("Outlook.Application")
objXML=Createobject("MSXML2.DomDocument")
objXML.load("objViewCalendar.XML")
objViewCalendar.XML = objXML.XML &&MUST KEEP THIS
objViewCalendar.Save
objViewCalendar.Apply
It is finished. Now just tie up any loose ends and integrate it into your COM object(s) and application. Refine your XML file directly, save it, and/or repeat/modify some of the steps above.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.