Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Thu, 3 Nov 2005 11:06:05 -0800,    group: microsoft.public.visio.troubleshoot        back       


Use of function .Cells and .CellsSRC with Visio and VB   
I'm using the custom properties section to store data from a Access Database. 
When I try to retrieve that data with a vb program using either .Cells or 
..CellsSRC I am only succesfull if the value field of the cust prop has a 
number (integer or real) in it. If the value is a string, both functions 
return a zero. 

prop.input1.value = 13  ......  both functions return 13
prop.input1.value = XSEL ...  both functions return 0


Any ideas?

Thanks
-- 
Fred
date: Thu, 3 Nov 2005 11:06:05 -0800   author:   Fred

Re: Use of function .Cells and .CellsSRC with Visio and VB   
Cells and CellsSRC are methods that return a Cell object, not a value.  The 
Cell object has a ResultIU property which is designated as the default 
property for the object.  Thus when you get a result from .Cells(cellName) 
you are really getting .Cells(cellName).ResultIU.  This property returns a 
numeric value converted to Internal Units (typically inches).

You can retrieve a string from a cell by accessing the ResultStr property on 
the Cell object.  ResultStr requires a parameter specifying the units that 
the string value should be converted to.  For example, 
..Cells(cellName).ResultStr(visFeet) would return a string value with feet 
units:  "3.15 ft."  For strings that have nothing to do with unit-ed values, 
use 0.  For example, .Cells(cellName).ResultStr(0) might return a string 
like "Apple".

To assign a string to a cell, it is generally best to use the Formula 
property on the Cell.  Strings assigned as formulas must be enclosed in 
quotation marks.  To avoid confusion with the quotation marks that you wrap 
strings in the VB editor with to identify them as strings, use Chr(34) to 
represent a quotation mark.  For example, .Cells(cellName).Formula = "=" + 
Chr(34) + "Apple" + Chr(34) would assign the string value 'Apple' to the 
cell.

-- 
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"Fred"  wrote in message 
news:9E1FB42E-E5CE-49ED-88A3-731DB66A63B4@microsoft.com...
> I'm using the custom properties section to store data from a Access 
> Database.
> When I try to retrieve that data with a vb program using either .Cells or
> .CellsSRC I am only succesfull if the value field of the cust prop has a
> number (integer or real) in it. If the value is a string, both functions
> return a zero.
>
> prop.input1.value = 13  ......  both functions return 13
> prop.input1.value = XSEL ...  both functions return 0
>
>
> Any ideas?
>
> Thanks
> -- 
> Fred
date: Fri, 4 Nov 2005 00:15:04 -0800   author:   Mark Nelson [MS]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us