?
Solved

VB.Net, Office, #$%^&@ Constants

Posted on 2004-04-20
3
Medium Priority
?
1,177 Views
Last Modified: 2012-06-22
Where do I get a listing of what the values are for Excel and Word constants that were perfectly legitimate (or at least some were) in VB 6 but seemed to have disappeared off the face of the planet for VB.NET

For example

   
    With objWS.Range("A1:M1")
        .HorizontalAlignment = xlLeft
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = True
    End With

I need to find values for xlLeft, xlCenter, xlRight, xlBottom, xlContext, ad. nausum.

Thanks,
K
0
Comment
Question by:Knomaze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
malharone earned 1000 total points
ID: 10872369
you've to explicitely refer to them using the Excel namespace.

eg.

worksheet.Range("A1:M1").VerticalAlignment = Excel.Constants.xlBottom
0
 
LVL 9

Expert Comment

by:malharone
ID: 10872406
if you can't find the enum/constant in Excel.Constants namespace,
the easiest way to locate them is go to Excel, Tools > Macros > VB Editor.
In the VBA, press F2 (or view > object browser) and enter the name of the constant and search for it. it'll list LIBRARY and CLASS columns. Use them as a namespace.
0
 

Author Comment

by:Knomaze
ID: 10872686
I was about to update the question that I FINALLY found the name space in the object browser with all the constants declared but then needed to know how I referenced it. This is exactly what I was looking for.

Thank-you,
K
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question