Q

How can I format an Excel spreadsheet with Notes?

I want to send information to an Excel spreadsheet. That works fine, but I would also like to be able to format the spreadsheet. Specifically, how do I tell it to center the text in a column? In Excel, a macro creates these lines:

With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
end With

But Notes doesn't understand xlCenter and xlBottom, so what codes am I supposed to use?
These are numeric constants defined in Excel VB, but not in LotusScript. To discover their values, create an Excel macro that displays them in a MsgBox:

Sub snoopy()
MsgBox "xlCenter = " & xlCenter & ", xlBottom = " & xlBottom
End Sub

For me, this generates the following output:

xlCenter = -4108, xlBottom = -4107

Now you can make your LotusScript code contain those same constants by adding the following statements in your Declarations section:

Const xlCenter = -4108 Const xlBottom = -4107

(You could just use the numbers in your code instead of constant names, but the constants make your code more readable).
 

This was first published in May 2003

Dig deeper on Web Development for Lotus Notes Domino

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close