PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Converting C# to VB .NET
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Converting C# to VB .NET
![]() |
Converting C# to VB .NET |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I'm converting some C# to VB .NET.
In an example that uses Outlook, I find the following C# statement: Outlook.AppointmentItem appointment = (Outlook.AppointmentItem)outlook.CreateItem( Outlook.OlItemType.olAppointmentItem); I do not understand how to convert the (Outlook.AppointmentIem) portion of the statement. -- http://www.standards.com/; See Howard Kaikow's web site. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Use CType
appointment = CType(outlook.CreateItem(Outlook.OlItemType.olAppointmentItem), Outlook.AppointmentItem) -- Manohar Kamath Editor, .netWire www.dotnetwire.com "Howard Kaikow" <kaikow@standards.com> wrote in message news:%23Pr%23qX4HFHA.3608@TK2MSFTNGP14.phx.gbl... > I'm converting some C# to VB .NET. > > In an example that uses Outlook, I find the following C# statement: > > Outlook.AppointmentItem appointment = > (Outlook.AppointmentItem)outlook.CreateItem( > Outlook.OlItemType.olAppointmentItem); > > I do not understand how to convert the (Outlook.AppointmentIem) portion of > the statement. > > -- > http://www.standards.com/; See Howard Kaikow's web site. > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanx.
I thought that it had to be something like that. -- http://www.standards.com/; See Howard Kaikow's web site. "Manohar Kamath" <mkamath@TAKETHISOUTkamath.com> wrote in message news:%23dF72f4HFHA.2740@TK2MSFTNGP12.phx.gbl... > Use CType > > appointment = > CType(outlook.CreateItem(Outlook.OlItemType.olAppointmentItem), > Outlook.AppointmentItem) > > -- > Manohar Kamath > Editor, .netWire > www.dotnetwire.com > > > "Howard Kaikow" <kaikow@standards.com> wrote in message > news:%23Pr%23qX4HFHA.3608@TK2MSFTNGP14.phx.gbl... > > I'm converting some C# to VB .NET. > > > > In an example that uses Outlook, I find the following C# statement: > > > > Outlook.AppointmentItem appointment = > > (Outlook.AppointmentItem)outlook.CreateItem( > > Outlook.OlItemType.olAppointmentItem); > > > > I do not understand how to convert the (Outlook.AppointmentIem) portion of > > the statement. > > > > -- > > http://www.standards.com/; See Howard Kaikow's web site. > > > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Howard:
Please feel free to download the Demo Edition of our Instant VB C# to VB.NET converter at http://www.instantvb.com. The Demo Edition is very useful for quickly converting small C# code snippets and it's fully supported. Regards, David Anton Tangible Software Solutions Inc. www.tangiblesoftwaresolutions.com Home of the Instant VB C# to VB.NET converter and the Instant C# VB.NET to C# converter "Howard Kaikow" wrote: > I'm converting some C# to VB .NET. > > In an example that uses Outlook, I find the following C# statement: > > Outlook.AppointmentItem appointment = > (Outlook.AppointmentItem)outlook.CreateItem( > Outlook.OlItemType.olAppointmentItem); > > I do not understand how to convert the (Outlook.AppointmentIem) portion of > the statement. > > -- > http://www.standards.com/; See Howard Kaikow's web site. > > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Howard,
"Howard Kaikow" <kaikow@standards.com> schrieb: > I'm converting some C# to VB .NET. > > In an example that uses Outlook, I find the following C# statement: > > Outlook.AppointmentItem appointment = > (Outlook.AppointmentItem)outlook.CreateItem( > Outlook.OlItemType.olAppointmentItem); > > I do not understand how to convert the (Outlook.AppointmentIem) portion of > the statement. '(Outlook.AppointmentItem)' is a type cast. \\\ Dim Appointment As Outlook.AppointmentItem = _ DirectCast( _ outlook.CreateItem(Outlook.OlItemType.olAppointmentItem), _ Outlook.AppointmentItem _ ) /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Thanks to those who responded.
I have two books that compare VB .NET and C#. The one from O'Reilly loses much of its value as there is no index! The one from APress has an inadequate index. For example, neither Ctype nor DirectCast is listed in the index, however, if one knows that a conversion function is required, there is an index item for conversion functions. So if one already knows the language from which one is translating, the book could be useful. I guess one has to fully read such books, but as a reference, they are inadequate. -- http://www.standards.com/; See Howard Kaikow's web site. "Howard Kaikow" <kaikow@standards.com> wrote in message news:%23Pr%23qX4HFHA.3608@TK2MSFTNGP14.phx.gbl... > I'm converting some C# to VB .NET. > > In an example that uses Outlook, I find the following C# statement: > > Outlook.AppointmentItem appointment = > (Outlook.AppointmentItem)outlook.CreateItem( > Outlook.OlItemType.olAppointmentItem); > > I do not understand how to convert the (Outlook.AppointmentIem) portion of > the statement. > > -- > http://www.standards.com/; See Howard Kaikow's web site. > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

