472,353 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Converting C# to VB .NET

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.
Nov 21 '05 #1
5 2734
Use CType

appointment =
CType(outlook.CreateItem(Outlook.OlItemType.olAppo intmentItem),
Outlook.AppointmentItem)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:%2******************@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.

Nov 21 '05 #2
Thanx.

I thought that it had to be something like that.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Manohar Kamath" <mk*****@TAKETHISOUTkamath.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Use CType

appointment =
CType(outlook.CreateItem(Outlook.OlItemType.olAppo intmentItem),
Outlook.AppointmentItem)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:%2******************@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.


Nov 21 '05 #3
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.

Nov 21 '05 #4
Howard,

"Howard Kaikow" <ka****@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.olAppointmen tItem), _
Outlook.AppointmentItem _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
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" <ka****@standards.com> wrote in message
news:%2******************@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.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mustafa | last post by:
Dear sir , I have built my application in visual basic 6.0 and crystal Report8.5 , Now i migrated my application to VB.net using the upgrade...
29
by: Armand Karlsen | last post by:
I have a website ( http://www.zen62775.zen.co.uk ) that I made HTML 4.01 Transitional and CSS compliant, and I'm thinking of converting it into...
8
by: prabha | last post by:
Hello Everybody, I have to conert the word doc to multiple html files,according to the templates in the word doc. I had converted the word to...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several...
3
by: Mary | last post by:
Hi, Does anyone know of any software out there that would convert an application written in VBScript to either VB.NET or C#/C++ quite quickly for...
2
by: Map Reader | last post by:
Greetings, I am converting an old VB6 application to use .NET. One of the old controls loads icons from the disk and displays them. However, the...
12
by: Frederik Vanderhaeghe | last post by:
Hi, I have a problem converting text to a double. Why doesn't the code work: If Not (txtdocbedrag.Text = "") Then Select Case...
7
by: Tor Aadnevik | last post by:
Hi, I have a problem converting values from Single to double. eg. When the Single value 12.19 is converted to double, the result is...
4
by: gg9h0st | last post by:
i'm a newbie studying php. i was into array part on tutorial and it says i'll get an array having keys that from member variable's name by...
2
by: shenanwei | last post by:
DB2 V8.2 on AIX, type II index is created. I see this from deadlock event monitor. 5) Deadlocked Connection ... Participant no.: 2 Lock wait...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.