473,881 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) portion of
the statement.

--
http://www.standards.com/; See Howard Kaikow's web site.
Nov 21 '05 #1
5 2803
Use CType

appointment =
CType(outlook.C reateItem(Outlo ok.OlItemType.o lAppointmentIte m),
Outlook.Appoint mentItem)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:%2******** **********@TK2M SFTNGP14.phx.gb l...
I'm converting some C# to VB .NET.

In an example that uses Outlook, I find the following C# statement:

Outlook.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) 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*****@TAKETH ISOUTkamath.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Use CType

appointment =
CType(outlook.C reateItem(Outlo ok.OlItemType.o lAppointmentIte m),
Outlook.Appoint mentItem)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:%2******** **********@TK2M SFTNGP14.phx.gb l...
I'm converting some C# to VB .NET.

In an example that uses Outlook, I find the following C# statement:

Outlook.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) 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.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) portion of
the statement.

--
http://www.standards.com/; See Howard Kaikow's web site.

Nov 21 '05 #4
Howard,

"Howard Kaikow" <ka****@standar ds.com> schrieb:
I'm converting some C# to VB .NET.

In an example that uses Outlook, I find the following C# statement:

Outlook.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) portion of
the statement.


'(Outlook.Appoi ntmentItem)' is a type cast.

\\\
Dim Appointment As Outlook.Appoint mentItem = _
DirectCast( _
outlook.CreateI tem(Outlook.OlI temType.olAppoi ntmentItem), _
Outlook.Appoint mentItem _
)
///

--
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****@standar ds.com> wrote in message
news:%2******** **********@TK2M SFTNGP14.phx.gb l...
I'm converting some C# to VB .NET.

In an example that uses Outlook, I find the following C# statement:

Outlook.Appoint mentItem appointment =
(Outlook.Appoin tmentItem)outlo ok.CreateItem(
Outlook.OlItemT ype.olAppointme ntItem);

I do not understand how to convert the (Outlook.Appoin tmentIem) 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
2470
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 wizard.My visual basic form is upgraded to vb.net but my .dsr file that i created using crystalReport is not migrated , when i try to convert it into .rpt file using add new item in Vb.net Envs it give me the error in the log file saying,
29
3923
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 XHTML to learn a little about it. Which XHTML variant would you recommend? The w3c HTML validator mentions XHTML 1.0 Transitional, Basic, Strict, and XHTML 1.1. Would I be able to make my existing CSS work in the XHTML page without modification to the .css file?
8
5750
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 xml.Also through Exsl ,had finished the multiple output html files. The problem is while reading through the worddoc paragraph,the special characters are not identified. So in the xml file,it's just storing that as "?".So I couldn't able to retrive the characters in my ouput html files.
5
2532
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 virtual directories that are independant applications. I am testing an upgrade of all of the sites and have converted the main root site...although not necessarily fixed any issues. I move on instead and converted one of the virtual roots that is a seperate
3
2435
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 me, or will I have to re-write the application myself. Any help much appreciated.
2
6206
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 transparent color turns to blue somewhere in the process. I narrowed it down to the conversion to IPictureDisp by first loading and saving the icon as a bitmap with no problems; and then repeating the process but adding the step of converting to an IPictureDisp as well. The first operation...
12
3206
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 ddlBedrag.SelectedIndex Case 0 Case 1
7
2720
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 12.1899995803833. Anyone know how to avoid this? Regards Totto
4
3205
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 converting an object to array. i guessed "i can get public members but not protected, private, static members"
2
5876
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 start time: 09/18/2006 23:04:09.911774 ...... Deadlocked Statement: Type : Dynamic Operation: Execute
0
9931
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10724
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10403
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9556
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7954
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.