displaying currency in vb.net from MS Project

J

Johnathan

Hi,

how to display the cost of a task including the currency symbol from a mpp
file? If I do this:
lblCost.Text = proj.Cost
I get only the value (e.g. 500) but I want '$500.00' instead. I tried use
the FormatCurrency function but this function only gives dollar sign '$'
symbol. What if I wan different currency symbol to be display, can it be
done?
 
R

Rod Gill

Hi,

Format the number to get 500.00 then use the proj.CurrencySymbol and
proj.CurrencySymbolPosition to add the correct symbol in front or behind the
number.

I just used the ActiveProject object in the immediate window of Project VBA
to find this or you could use the Object Browser in Project VBA and search
for Currency. It is often quicker and easier to write your code in VBA first
then copy paste into VB.Net and add project objects.
--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top