zaabdullah

Hi

I have dotnet 2005 application.I want to fill appontment from my customer data programaticaly.If any one can help on this please.

Zaabdullah



Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

Sue Mosher - Outlook MVP

In a non-Exchange environment, use iCalendar to display the appointment to the user and let them save it.

In an Exchange environment, you have the option of using WebDAV to interact directly with the server.

Neither VSTO nor Outlook code is involved in either solution, so you'll want to follow up on other forums.





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

zaabdullah

Hi

Thank You for reply.The other thing may solve my problem. If I could in outlook inviroment get data from Access to fill appointment form in outlook.

in outlook

zaabdullah





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

Sue Mosher - Outlook MVP

For some reason, I read your original post as relating to ASP.NET, not .NET in general. Sorry about that.

To create a new appointment, use the Application.CreateItem method from the Outlook object model.

Use standard ADO.NET methods to access the database and get the information you need to fill in the properties on the Outlook.AppointmentItem.





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

zaabdullah

Hi Sue

I am using this code to send appointment to outlookfrom different .It do not give any error but also I do not see any result. If you could send me small example.I am not eexperenced.Thank you.

Zaabdullah

Code

Imports Microsoft.Office.Tools.Outlook

Imports Microsoft.Office.Interop

Public Class Form1

Private App As New Microsoft.Office.Interop.Outlook.Application

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Dim newAppItem As Microsoft.Office.Interop.Outlook.AppointmentItem

' App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

' newHistoryTaskItem = MSO.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olJournalItem)

newAppItem = App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

newAppItem.Subject = "Meet to me"

newAppItem.Body = "Let me know please"

newAppItem.Start = #2/3/2007 1:30:00 PM#

newAppItem.Duration = 40

newAppItem.Save()

End Sub

End Class





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

Sue Mosher - Outlook MVP

Nothing jumps out at me. What happens when you step through the code in the debugger Is Outlook already running

Also, it looks like you're not writing code for a VSTO addin, which means that you should be posting in either a general VB.NET forum or an Outlook forum, such as the microsoft.public.outlook.program_vba newsgroup.





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

zaabdullah

Hi Sue

I am writing Doctor office Application. I want to do appointments in Outlook.Actually I want to do boath ways.

1:-If I am in outlook want to get patient no and name and make appointment.

2:-If I am in My Doctor office app want to creat Appointment.This one I put the code in my previous post.after your mail

I ran again it worked.Thank you.

please if you could start me form OutLook side.

I tried same code in addin

public class ThisAddIn

Private WithEvents tyINS As Outlook.Inspectors

Private WithEvents App As Outlook.AppointmentItem

Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

Me.tyINS_NewInspector(tyINS)

End Sub

Private Sub tyINS_NewInspector(ByVal Inspector As _

Microsoft.Office.Interop.Outlook.Inspector) _

Handles tyINS.NewInspector

Dim newAppItem As Microsoft.Office.Interop.Outlook.AppointmentItem

' App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

' newHistoryTaskItem = MSO.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olJournalItem)

newAppItem = App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

newAppItem.Subject = "Call me"

newAppItem.Body = "As soon as possible"

newAppItem.Start = #2/4/2007 10:30:00 PM#

newAppItem.Duration = 15

newAppItem.Save()

End Sub

Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

End Sub

I get this error

System.NullReferenceException: Object variable or With block variable not set.
at Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at MakeApp.ThisAddIn.tyINS_NewInspector(Inspector Inspector) in C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\MakeApp\MakeApp\ThisAddIn.vb:line 20
at MakeApp.ThisAddIn.ThisAddIn_Startup(Object sender, EventArgs e) in C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\MakeApp\MakeApp\ThisAddIn.vb:line 7
at Microsoft.Office.Tools.AddIn.OnStartup()
at MakeApp.ThisAddIn.FinishInitialization() in C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\MakeApp\MakeApp\ThisAddIn.Designer.vb:line 67
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecutePhase(String methodName)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteEntryPointsHelper()
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.Microsoft.VisualStudio.Tools.Applications.Runtime.IExecuteCustomization2.ExecuteEntryPoints()


************** Loaded Assemblies **************


Zaabdullah





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

Sue Mosher - Outlook MVP

I can't tell what this statement is trying to do:

Me.tyINS_NewInspector(tyINS)

The statement to instantiaed the Inspectors collection declared WithEvents would be:

tyINS = Me.Inspectors

I also don't understand why you're using the NewInspector event to create a new appointment. Surely you don't want to create a new appointment each time the user opens a message, edits a contact, creates a task, etc.

I don't see any statement to instantiate the App object used in this statement:

newAppItem = App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

This is VSTO 2005 (not SE) You should be able to use Me.CreateItem.

It also helps immensely if you indicate which statement raises an error.





Re: Visual Studio Tools for Office Fill in outlook appointment from dotnet application

David Hernandez Diez

I think you need to change this line:

newAppItem = App.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)

for this one:

newAppItem = this.Application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem)