Hi Guys Problems compiling outlook code in X# Can anyone help please
Posted: Mon Apr 08, 2019 3:00 pm
Hi Guys and Chris,
Sorry to bother you again but I am afraid I cannot get the code to compile properly in X# there seems to always be an error regardless which variant I try this simple code also wont work. Yesterday I sent you something similar for the contacts to show the contacts in outlook I cannot get it to compile error free. Some of the code that I had for Vulcan use to work but it does not in X# because of compile errors. Can you please help. Is it possible to ask your colleagues if they are also encountering the same problems. There must be a possibility of a general fix. Code that used to work Vulcan 32 bit just has compile errors in X#.
Thanks
Raymond
FUNCTION Calendar() AS VOID
/* Original Code VB.Net Chris Cannot compile it error free in X#
Dim myNamespace As Outlook.NameSpace
Set myNamespace = Application.GetNamespace("MAPI")
Set Application.ActiveExplorer.CurrentFolder = _
myNamespace.GetDefaultFolder(olFolderCalendar)
*/
LOCAL _myNamespace AS Microsoft.Office.Interop.Outlook.NameSpace //Outlook.NameSpace
LOCAL outApplication AS Microsoft.Office.Interop.Outlook.Application
_myNamespace := outApplication.GetNamespace("MAPI")
outApplication.ActiveExplorer.CurrentFolder := _myNamespace.GetDefaultFolder.olFolderCalendar //(olFolderCalendar)
RETURN
error XS0119: 'Microsoft.Office.Interop.Outlook._Application.ActiveExplorer()' is a method, which is not valid in the given context 370,5 Ray_Outlook.prg FormApp6
error XS0119: 'Microsoft.Office.Interop.Outlook._NameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders)' is a method, which is not valid in the given context 370,5 Ray_Outlook.prg FormApp6
Sorry to bother you again but I am afraid I cannot get the code to compile properly in X# there seems to always be an error regardless which variant I try this simple code also wont work. Yesterday I sent you something similar for the contacts to show the contacts in outlook I cannot get it to compile error free. Some of the code that I had for Vulcan use to work but it does not in X# because of compile errors. Can you please help. Is it possible to ask your colleagues if they are also encountering the same problems. There must be a possibility of a general fix. Code that used to work Vulcan 32 bit just has compile errors in X#.
Thanks
Raymond
FUNCTION Calendar() AS VOID
/* Original Code VB.Net Chris Cannot compile it error free in X#
Dim myNamespace As Outlook.NameSpace
Set myNamespace = Application.GetNamespace("MAPI")
Set Application.ActiveExplorer.CurrentFolder = _
myNamespace.GetDefaultFolder(olFolderCalendar)
*/
LOCAL _myNamespace AS Microsoft.Office.Interop.Outlook.NameSpace //Outlook.NameSpace
LOCAL outApplication AS Microsoft.Office.Interop.Outlook.Application
_myNamespace := outApplication.GetNamespace("MAPI")
outApplication.ActiveExplorer.CurrentFolder := _myNamespace.GetDefaultFolder.olFolderCalendar //(olFolderCalendar)
RETURN
error XS0119: 'Microsoft.Office.Interop.Outlook._Application.ActiveExplorer()' is a method, which is not valid in the given context 370,5 Ray_Outlook.prg FormApp6
error XS0119: 'Microsoft.Office.Interop.Outlook._NameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders)' is a method, which is not valid in the given context 370,5 Ray_Outlook.prg FormApp6