G
Guest
My code works as a VB.NET executable file. So I'm trying to "adapt" it to a
..NET XML Web Service. As a VB.NET file, I used Microsoft.Office.Core as the
reference, and everything was fine, but when I try to do the same thing as an
XML Web Service, VS.NET says my syntax is not defined.
Can anyone tell me why the syntax is not defined?
<WebMethod()> _
Public Function HelloWorld() As String
Try
Dim app As Microsoft.Office.Interop.Outlook.Application
Dim appt As Microsoft.Office.Interop.Outlook.AppointmentItem
app = New Microsoft.Office.Interop.Outlook.Application
appt =
app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)
appt.Subject = "Subject of this meeting"
appt.Save()
MsgBox("Your appointment has been successfully scheduled.")
Catch ex As Exception
MsgBox("There was a problem, the error is: " & ex.ToString())
End Try
End Function
..NET XML Web Service. As a VB.NET file, I used Microsoft.Office.Core as the
reference, and everything was fine, but when I try to do the same thing as an
XML Web Service, VS.NET says my syntax is not defined.
Can anyone tell me why the syntax is not defined?
<WebMethod()> _
Public Function HelloWorld() As String
Try
Dim app As Microsoft.Office.Interop.Outlook.Application
Dim appt As Microsoft.Office.Interop.Outlook.AppointmentItem
app = New Microsoft.Office.Interop.Outlook.Application
appt =
app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)
appt.Subject = "Subject of this meeting"
appt.Save()
MsgBox("Your appointment has been successfully scheduled.")
Catch ex As Exception
MsgBox("There was a problem, the error is: " & ex.ToString())
End Try
End Function