Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Vba Code For Selecting A Paragraph In Word


In Word -- Can anyone tell me the vba code for selecting the entire paragraph currently containing the insertion point? Thanks.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Accesing The Paragraph By Selecting The TOC In Word
Hello,

I am trying to delete the content in the word document by highlighting the field in the TOC.

For e.g when I hightlight the Chapter 1 in the Table of Content it should create a new word document without the Chapter 1.

Could someone please help me with this. I am able to access the contents if I specify the Paragraph no.

But could someone tell me how do I get link the TOC and the Paragraphs in the content,

Thanks,

Selecting A Paragraph And Moving Cursor ...
How do I select a paragrapgh, copy I guess using "Selection.Copy" then move the cursor to the begining of the next until EOF?

Word VB: Paragraph End
Hi folks,

I am iterating through a range.paragraphs, catching each paragraph and modifying the begining and the end.
Is there a direct approach to get to the end of paragraph( basically the last non white space character). I am trying the range.endof with unit as paragraph and actually get the first letter of the next para.

Any help would be appreciated.
thanks.

Add Paragraph In Word File Through Vb6.0
i wnt to add text in file as the value of one text box as one paragraph, second text box'value as 2nd paraph and 3rd as textbox 'value as 3rd paragraph????how can i add that???

Word GOTO Paragraph
Hi friends,

What is the best way to navigate to a particular paragraph? For eg., I want to go to the 21st paragraph. What should I do?

At present I am using the following code to do this. The code is:
Code:Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdParagraph, Count:=myParaCount 'myParaCount is a variable


Is there anyother way to do this, because, this one is very slow, if I operate this on a big document?

Thanks
Srik

[Anyone?] Need Help With Paragraph Alignment In MS-Word
EDIT: Still looking for suggestions! Would it help to move this question to the general VB.Net forum? Thanks!

Hello and thank you for reading my post!

My problem is actually with Visual Basic.Net programming in MS-Word, and not strictly VBA, but this seemed like the best place to post my issue.
If anyone feels this should be posted in a different forum, please let me know so that I can make the change!

Problem: I cannot affect the alignment of an MS-Word paragraph from within a VB.Net windows application.
I have tried many different permutations, but none have any affect. The code below contains what I believe should work, but it does not.

In particular, I am invoking the following statement to affect alignment:
pghTotal.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter

I have also tried to affect the alignment at the Word.Application level, Selection level, Paragraph level, Range level, etc. Nothing has worked.

I would greatly appreciate any comments! Thank you very much!

Code:Imports Word = Microsoft.Office.Interop.Word

.
.
.

Private Sub Statements_Process_One(ByRef statement As CStatement, ByRef appword As Word.Application)

' declare MS-WORD variables
Dim docStatement As Word.Document
Dim pghTotal As Word.Paragraph

docStatement = appword.Documents.Add(constant.TEMPLATE_STATEMENT)

.
.
.

Dim strMessage As String = ""
strMessage = constant.MSG_STATEMENT_TOTAL.Replace("&TOTAL", FormatCurrency(decBal))
pghTotal = docStatement.Content.Paragraphs.Add(docStatement.Bookmarks.Item("endofdoc").Range)
pghTotal.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
pghTotal.Range.Font.Bold = True
pghTotal.Range.Font.Italic = False
pghTotal.Range.Font.Color = Word.WdColor.wdColorBlue
pghTotal.Range.Font.Size = 14
pghTotal.Range.Text = strMessage & Environment.NewLine

.
.
.

End Sub

Frank Roscoe - Technology Manager
Vehicle Service Equipment
www.vsequip.com

Edited by - froscoe on 7/5/2006 5:53:50 AM

Paragraph Capture In Word Using VB
Hi all....

I need to capture a set of paragraphs in MSWord using a VB application to fill in a DataBase.
The fields will be in three different and consecutive paragraphs in Word 97.
How can I do this capture?

Word Paragraph Formating Stumper!
I am trying to write some VBA code that formats some text in a Word document and am stumped on how to do a particular procedure. Without gettting to long winded the document is a Questionairre with a layout like this....

'*********************************************************
11. This is a sample question with several
sentences that spill over several lines.
There are several tab stops that contain
various answers to the question ...............1.......2.......3.......4.......5

'*********************************************************

I run some code that deletes all the tabs. I want the question to now extend the entire length of the page but it doesnt. So after I delete the tabs the question looks like this.


'*********************************************************
11. This is a sample question with several
sentences that spill over several lines.
There are several tab stops that contain
various answers to the question
'*********************************************************

But I want it to look like this.....

'*********************************************************
11. This is a sample question with several sentences that spill over several lines. There are several tab stops that contain various answers to the question
'*********************************************************

If I manually go to the end of the first line and push delete the second line will then jump up to the first line and I get the desired format but it seems to me that there must be some code or a property that can accomplish this? Does anyone have any suggestions?

Thanks!!

Mike

How Do You Reference The Paragraph Mark In Word
Hi,

What is the way to refer to a paragraph mark in Word?

I want to say like, If Footer = ( reference for paragraph mark - chr(something) ??)

Thank you

Word 97 - Extend Selection To End Of Paragraph? (fixed)
I can extend to the end of a line "Selection.EndKey Unit:=wdLine, Extend:=wdExtend"
But how do I extend to the end of the paragraph? "Selection.EndOf Unit:=wdParagraph, Extend:=wdExtend" doesn't work?


<EDIT>Actually it does. Forget I asked....</EDIT>


 

Edited by - RicardoSmith on 8/20/2003 9:12:11 AM

Paragraph Creation And Passing It's Text From The VB Form To Word Doc.
Hi,
I am new to the Creation Of Word/Excel Objects.
I am developing an application in VB. A Word Document is created at the click event of a button from the form.
I want to pass some text in the initial two paragraphs of the document while it is created. Till now I am unable to pass this text.

Please do provide your suggestions or links for this problem.
--

How To Capture Mouse-click Event For A Paragraph In MS WORD.
Friends,
Some of the buttons in MS office toolbars have additional functionality when you double click them.. e.g. Format painter button in Word. When this button is double clicked it stays selected and subsequent document clicks are captured and the selected word/sentence are formatted. I want to make a similar button which remains pressed when it is double clicked and then inserts a word at the curser position whenever i click the document.
Would be glad if someone helps me in this.
Laila

Character, Word, Sentence, &amp; Paragraph Counts Of A Text File
I am between a newbie and a general question.
Yes it is homework. I am not looking for the whole answer just pointed in the correct direction.
I have to configure for these items (Character, Word, Sentence, & Paragraph counts of a text file) inside a class read-only property. The file will come from either a string, which was entered into a text box by the user in they application and then "set" into the class string property via aclass read-write property or a file from a openfiledialog choice by the user which would go into the read-only property.

How Do I Compare Paragraph Mark In Code
HI...

I need to compare if a certain character is a paragraph break or not. Basically my code is like this:

If SelectedRange.Characters.Last = "^p" Then
...
...
end if

I thought this should work, because this is how word finds paragraph breaks when you do (in word) Edit -> Find -> special -> Paragraph Mark.

But this is not working. I also tried to comapre it with vbCRLf or vbLf, but still it does not work...

Can anyone tell me how to get the paragraph marks in a range...?

Thanx
vikram db

Word.Fields Creates Difference Between Selection.Range And Paragraph.Characters()
Context: VB6, fields preceding or in selection.

Primary Question: Given a Word.Field, how can I determine its display length -- the length of text displayed to the user.

I've now run into my second instance where Word field codes are throwing off my code for selecting text in a paragraph, when the field codes are in the same paragraph but precede the selection.

It looks like Selection.Range.Start and End use the Field.Code length while Paragraph.Characters() does not. Therefore, whenever I base my Characters() index on Selection.Range.Start or End and there is one or more preceding fields, my index is too large (and sometimes greater than Characters().Count).

My last approach, to determine the field code's display length was:


Code:
' Determine the display length of the given field code.
Public Function GetFieldDisplayLength(ByRef f As Word.Field) As Long
Dim length As Long
' If this field's codes are displayed, use that length
If (f.ShowCodes) Then
length = Len(f.Code)
' Else, use the field's result length
Else
length = Len(f.Result)
End If
GetFieldDisplayLength = length
End Function
Unfortunately, Word.Field.Result is not always what is displayed to the user. I have some fields that do not have a display length yet do have a result.

Continuing this approach, once I can determine the display length of a field code, I can convert Selection.Range.Start or End into the equivalent value within Paragraph.Characters().

Any ideas? Is there an alternative approach? Thank you.

How Do I Code A Sub That Turns An 8 Byte Hex String Into A Sentence Or Even Paragraph
example:

if I had this:

"ee de ba d1 .....up to 8th byte in hex."

then I want something like that:

"I need your help badly......etc."

it is too hard for me cause it envolves grammar/phrase builder

thanx to all

Selecting A Particular Word From A Word Document (.doc) Through Visual Basic 6
I am a developer using Visual Basic 6. One of my program accepts some values through text boxes and then creates a Word document. The text boxes are optional, and the created Word document contains only non-empty values along with appropriate labels. I am able to apply styles (bold and underline) to entire paragraphs. But the user wants me to apply bold formatting only to values entered by him and not to the labels which describe those values. Please help me.

Thank You.

Lalit Kumar Barik
India

How To Display Multiline Paragraph And Input Multiline Paragraph In What Vb Control?
good day to all! how can i display multiline paragraph? and how can i input such paragraph in a multiline way. What vb control will i use, can you give me some code to extract idea from it?

Selecting A Bookmark In WORD From VB6
I've been working on a VB app on a certain machine for a while, and got it to work.

Now I'm working on a different machine trying to get the same app to work, and I'm having problems. I got through a couple of DLL issues.

The app reads from a MSDE database and generates a WORD document, plugging in data from the database into the appropriate bookmarks on the document.

I have a ton of lines of code like this one, and now it's failing:

WordDoc.Bookmarks("bookmark_name").Select

I'm getting this error:

Object variable or With block variable not set

I made sure the word document I'm working on is where it should be. The code is finding the document. I checked a bookmark and verified that it's still in the document.

Does anyone have an idea as to why the same line of code works on one machine and not another? Could it be a another DLL issue? I'm completely baffled on this one.

Thanks...

Laz

Selecting ALL Text In Word Doc...
Ok, I load a word doc in VB using the Word objects...how to I get ALL the text and paste it into a standard textbox???

Woka

VBA Selecting A Picture In MS Word
Hi,

I would like to know the syntax to select a picture (and more than 1 picture) and format the picture like bring to front and send to back.

Thanks.

Selecting Certain Range In Word Using VB6.0
Hi,

Can anyone please help me?

I am trying to build program that automatically copies certain information in a Word Document and copy it to a specific cell of an Excel Document. I have a questions regarding Selecting certain range within a Word document. However, I am not sure if this can be done...

--> How do you write a code that will search a word document and look for "Sort Total" in that word document (Assuming there is only one "Sort Total".), and then selecting characters# 20 to 22 exactly 5 sentence below the "Sort Total"?

The reason I need to do this is because I am given multiple word documents in similar formats, with a specific table under the title "Sort Total", but the location of that table is different from file to file, so I cannot simply set up a range code to extract the information for every word document.

PS: OR if anyone could tell me how to convert Word Tables into Excel Tables? The problem is that the file is in .sum extension (openable by word), but it reads as pure text and the table is actually word columns/rows aligned, but not in actual table within the document.
---------
The following link is the most related information I've found on the net...
http://msdn.microsoft.com/library/d.../WordObject.asp
This Information is for .NET, but I need VB6.0.

Selecting A Whole Page Of A Word Doc.
I only want to select the whole text of a concret page that is in a word document.
I dont know how to start the selection at start of page, and end the selection at end of page.

Thanks!

sercrusa

Selecting Text In Word
How can I set a cursor in a spesific place in a Word document with a macro? I would need a code, that selects the path from hyperlink code just like user would have drag over it with mouse. Finding a link code is not the problem but dealing with select/cursor.

Selecting A Specific Word Table?
I need to be able to access a table in word using vb6. I know how to access data in a table by using the Table(1) feature, but i need to be able to access the table without knowing where it exists in the document prior to running my tool. For example, the table i need may be the first table in the doc one time and then be the third table the next time. So i thought maybe i could trigger off of the caption somehow. Any ideas? below is how i am currently doing it.

If curTable = 1 Then
Count = 1
endOfTable = False
curTableString = "TableOne"

Set tblOneData = New Tables

While Not endOfTable
UpdateActivityBar ProgressBarActivity.ActiveBar, 0.1
Count = Count + 1
If Not endOfTable Then
endOfTable = wrdDoc.Tables(curTable).Rows(Count).IsLast
End If
Wend
.
.
and so on.

Another Problem In Selecting An Image In Word
hi there,

last friday i posted a message about inserting an image a table in Word where i want to alter the properties from. I've got an answer from Herilane an that helpt a lot, but now there is still a little problem with it. When i get the posibillity to use "WrapFormat" i get an error "Method or datameber not found" and when i change the declaration of "WhereToPutPicture" in "Word.InlineShape" in stead of "InlineShape" then it displays the error "Argument not optional" at "With WhereToPutPicture.Find" I know what these errors represent, but i just can't figure it out with the declaration. Can anyone help?

Thanks in advance


Code:
Dim TargetTable As Word.Table
Dim WhereToPutPicture As Word.Range
Dim NewPic As InlineShape

If FileName1 = "" Then
FileName1 = Fr1.lbl_FileName.Caption
End If
i = 0

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Open(FileName1)
objWord.DisplayAlerts = wdAlertsNone
objWord.Visible = True
Set TargetTable = objDoc.Tables(1)
Set WhereToPutPicture = TargetTable.Range

With WhereToPutPicture.Find
.ClearFormatting
.MatchCase = False
.MatchWildcards = True
.Text = "$???$"

If .Execute = True Then
'WhereToPutPicture now holds the range where the text was found
'now insert the picture after the found text
WhereToPutPicture.Collapse wdCollapseEnd
ModuleType = TargetTable.Cell(2, 2) 'Looks at cell 2,2 of a table
ModuleType = Mid$(ModuleType, 2, 3)
vervang_word
Set NewPic = WhereToPutPicture.InlineShapes.AddPicture(Vervanging)
'Vervanging holds the url for the picture
NewPic.WrapFormat = wdWrapNone
End If
End With

Selecting A Whole Cell In A Word Table
Hi there.

I'm struggeling with the following:

I have a Word document with 2 columns. It contains 100 rows, which gives a total of 200 cells.
One of the rows are looking something like this:
_______________________________
|________________|______________|

In my code, I'm able to locate/find the correct row I want to do my selection.
I have a bookmark (called "Labelx" where x is the number of the cell) in every cell.
I'm able to select the first cell (that is the cell to the left), and I'm also able to put my cursor in the next cell (the one to the right).

The big challenge is to "mark"/highlight/select the cell to the right.
The purpose is that I want to select this cell and delete all the contents in it.

Can anyone give me some direction?

So far I have this code:
BookM = "Label" & (i+2) 'This selects the bookmark in the row below the row I want to delete
ActiveDocument.Bookmarks(BookM).Range.Select
Selection.MoveUp Unit:wdLine, Count:=1
Selection.EndKey Unit:=wdStory, Extend:= wdExtend
Selection.Delete

This code, selects all the remaining rows in the documents and deletes them. This is my purpose.
But I also want the code to delete the cell to the right in the last row AFTER deleting the remaining rows.

Hope that my explaination is good enough, if not - give me a hint and I will try to improve.....

Selecting Part Of Cell In Word
Hello,

in my application i send a pricelist to word.
It's placed in a table.
Now i want to select a part of the first cell in the row and set it bold.
Is this possible and how would you do it.

For example:
new
vbcr
article1

I want to put "new" in bold.

???

Selecting Groups Of Shapes In Word???
Hello all,

From the traditional Word interface, if you select multiple shapes, then right click and select group it groups all of the selected shapes together. My problem is, how do I select and operate on this group through code? Do I treat it like a shape, or is it something different?

EDIT: -
OK, sorted out the selecting part (I think) I'm accessing the groupItems object (advise if you know better) but I can't work out how to insert this into another document. If anyone has done anything similar a code sample would be most helpful

Thanks in advance for any help.


Noogle

Edited by - original_noogle on 5/26/2004 8:21:55 AM

Selecting Text In A Word Table Cell
This has probably been answered many times before but I can't find the solution. I need to insert some text into a Word table and then change the font without affecting the text that was already in the cell. My code will look something like this:


Code:
Set oWord = CreateObject("Word.Application")

' Create a new Word document based on works_oder.dot template
oWord.application.Documents.Add App.Path & " emplatesworks_order.dot"
oWord.Visible = True
oWord.Activate

With oWord.ActiveDocument.tables(1) ' First table in Word template
.cell(1, 2).range.insertafter "Temp 0001"
.cell(2, 1).range.insertafter " " & cmbCustomers
.cell(2, 2).range.insertafter vbCrLf & txtDrawingNo
.cell(2, 4).range.insertafter vbCrLf & txtWorksOrderNo
.cell(3, 1).range.insertafter " " & txtCustOrderNo
.cell(4, 1).range.insertafter vbCrLf & txtRequiredBy
.cell(4, 2).range.insertafter vbCrLf & txtDescription
End With


I guess I need to select the text I've just added and then apply the font formatting I need, but I can't quite work out the syntax to select just the new text and exclude the original contents of the cell. Thanks!

Selecting A Tab By Code
Wotcha, folks.

How do I select a Tab by code rather than clicking on it?

I have a Job number that is selected on one tab, I then want it to switch Tabs and populate that tab with that Job number's details.

I've save the Job number to the clipboard - i just need to switch tabs.

Much ta.

Jack.

Highlighting Or Selecting Multi Texts Into A Word Document
hi friends,
i am doing one application to search multiple texts in a word document file. i am displaying all those docs which contains the texts in a list view.
after double click of the filename in list view it has to open the document with selecting or highliting the search criteria.That is those text which we are searching for.
i am able to select the last search text only not all. i want to select or highlight all the search criteria.

Please help me.

regards/ Mahesh

Selecting Database In VB Code
Having solved my last problem of getting the select query to work with a variable parameter, i'm now faced with something similar.

My problem here is I want to be able to change the database i'm using by changing the required values in the connection string.

However, although it seems that my entered required values (DSN, description and database) are in the connection string, i am still prompted for this information once the i reach the end of the with statement. This is apparently because some of the required values are missing. But i didn't think they were.... I'm therefore pretty confused.
Does anyone know how to get the required values to be recognised???
Many many thanks if anyone can.

I'll paste the code:

Code:
DSN_var = Cells(3, 2)
Description_var = Cells(4, 2)
Database_var = Cells(5, 2)
surname = Cells(6, 2)

With ActiveSheet.QueryTables.Add(Connection:="ODBC;(DSN= '" _
& DSN_var & "' );(Description='" & Description_var & _
"');UID=usertom;PWD=1234567;APP=Microsoft® Query;WSID=MTFRM005;(DATABASE='" _
& Database_var & "');Network=DBMSSOCN", Destination:=Range("A8"))
.CommandText = Array("SELECT contacts.surname, contacts.contact_number, contacts.forenames" _
& Chr(13) & "" & Chr(10) & "FROM Rugby.dbo.contacts contacts" & Chr(13) & "" & Chr(10) _
& "WHERE (contacts.surname= '" & surname & "' )" & Chr(13) & "" & Chr(10) _
& "ORDER BY contacts.contact_number")
.Name = "Query from Rugby_4"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With

Selecting A Tab In Tabstrip Via Code
Hi All,

This has stumped me, I am sure it must be easy, so could someone tell me how to change the TabStrip1.SelectedItem.Index
via code, below code doesn't work

Set TabStrip1.SelectedItem = 2

Thanks

David

ListView, Selecting Via Code?
After I fill my listview control, I want to automatically select the first entry, which I do via:

Code:
lstRoster.ListItems.Item(1).Selected = True
Call lstRoster_ItemClick(lstRoster.ListItems.Item(1))


but the item isn't actually selected, how do I do that?

Selecting Text In Code
How can this magic be done? I tried the sellength and stuff propertys, but none had any effect. So how does one select text in a textbox? (Or highlight it..)

Selecting A Tabstrip Tab In Code
Does anyone know how to programatically select a tabstrip tab to make it the active tab. I am getting nowhere on this one. Thanks in advance!!

Selecting Paper Source On Printer Based On Word Document
hello, I have some different type of MSWORD documents (label, letter head, envelops etc.) that I want to be printed on different trays of my printer automatically as I have different paper types loaded in each tray. I have templates of these documents and RICOH (http://www.ricoh-usa.com) 1060 and 1075 printers. These printers have different trays for different types of paper and can be reconfigured to load various types of paper. My application runs as a batch job and has to print lots of documents unattended. I want to select different printer tray based on different type of document template. I can enable paper source in template but the tray configuration can be changed on the printer so I can not rely on that. Also macros are not available so that option is also out. I need to do it from with in my application.
I am using VB6 on Windows 2000 machine.

Selecting A Datagrid Record Via Code
I have a datagrid that is bound to a recordset. When a user changes the device type, it adds a new device to the recordset. I cannot figure out how to select the new row in the datagrid programmatically so that all the subsequent changes that the user makes will only affect that item in the datagrid. Heres the code:


Code:
Private Sub cmbDevType_Click()
'Populate items possible for this type
Call PopulatePossible
'Test to see if this device already exists, if it doesn't, display message to user asking to add it.
SQLstmt = ""
SQLstmt = "SELECT * FROM quote_devices where device = '" & cmbDevType.Text & "' and Quote_ID = " & lnQuoteID & ""
Dim RS_devices As ADODB.Recordset
Set RS_devices = New ADODB.Recordset
RS_devices.Open SQLstmt, dblocA, adOpenStatic, adLockOptimistic, adCmdText
If RS_devices.RecordCount = 0 Then
msg = MsgBox("Would you like to add this device to the quote?", vbYesNo)
If msg = vbYes Then
lnQuoteItem = lnQuoteItem + 1
RS_devices.AddNew
RS_devices!device = cmbDevType.Text
RS_devices!Qty = 1
RS_devices!Quote_Item = lnQuoteItem
RS_devices!Quote_ID = lnQuoteID
RS_devices.Update
'The datagrid is called grdDevices
'Here I am repopulating the datagrid
Call PopulateDevices
'But I need to be able to select the new record.
'The previous datagrid record is still selected.

grdExisting.ClearFields
End If
End If
End Sub

'Heres the code that populates the device datagrid
Public Sub PopulateDevices()
lnQuoteTotal = 0
Set grdDevices.DataSource = Nothing
'Get all devices in this quote
SQLstmt = ""
SQLstmt = "Select quote_item, qty, device, description, each, total from quote_devices where quote_id = " & lnQuoteID & ""
Dim RS_device As ADODB.Recordset
Set RS_devices = New ADODB.Recordset
RS_devices.Open SQLstmt, dblocA, adOpenStatic, adLockOptimistic, adCmdText
'Get Quote Total
While Not RS_devices.EOF
lnQuoteTotal = lnQuoteTotal + RS_devices!Total
RS_devices.MoveNext
Wend
'Display total for this quote
txtTotal.Text = FormatCurrency(lnQuoteTotal, 2)
txtTotal.Refresh

'Fill grdDevices
If RS_devices.RecordCount <> 0 Then
'Go back to top of recordset
RS_devices.MoveFirst
grdDevices.Enabled = True
Set grdDevices.DataSource = RS_devices
'Format grid
With grdDevices
.Columns(0).Caption = "#"
.Columns(0).Locked = True
.Columns(0).Width = 500
.Columns(1).Caption = "QTY"
'.Columns(1).Locked = True
.Columns(1).Width = 500
.Columns(2).Caption = "DEVICE"
.Columns(2).Locked = True
.Columns(2).Width = 700
.Columns(3).Caption = "DESCRIPTION"
.Columns(3).Locked = True
.Columns(3).Width = 2700
.Columns(4).Caption = "PRICE EACH"
.Columns(4).Locked = True
.Columns(4).NumberFormat = "Currency"
.Columns(4).Alignment = dbgRight
.Columns(4).Width = 1150
.Columns(5).Caption = "TOTAL"
.Columns(5).Locked = True
.Columns(5).NumberFormat = "Currency"
.Columns(5).Alignment = dbgRight
.Columns(5).Width = 1150
End With
Else
grdDevices.Enabled = False
End If
'Reset recordset
Set RS_devices = Nothing

End Sub

Selecting SSTab Tabs With Code
I need to select individual SSTab tabs with code but I don't know how to do it.

Like for example...

Private Sub Form_Load()
SSTab.Tab1.Picture = ImageList.ListImages(1).Picture
SSTab.Tab2.Picture = ImageList.ListImages(2).Picture
End Sub

Private Sub Form_Load()
SSTab.Tab(1).Picture = ImageList.ListImages(1).Picture
SSTab.Tab(2).Picture = ImageList.ListImages(2).Picture
End Sub

But those don't work.

Selecting Item In Combo Box Via Code
What's the method to select an item in a combo box and make it show up in the closed combo box?
Eg. I populate a combo box with 15 items by code. Now nothing is selected. I want to make an item visible. What method do I use it and what is the syntax?
Thanks.

Selecting A Cell Through Code With MSHFlexgrid
Hi all.

I'm trying to force selection (through code) of the first row on a MSHFlexgrid and I can't seem to figure out how!

Just in case, Highlight property of the grid is set to "Never" and FocusRect to "Heavy".

Thanks!

Alain

Selecting A Particular Row From Access Form Using VB Code
hi,
i have a form where there are 6 rows............how can i select a particular row from that?

THANKS!!

regards
vivek.s

Selecting A Record On A DBGrid With Code
Hi team

I want my DBGrid to open with a specific value (chosen on another form). How do I tell the DBGrid to find a specific record and then set that record as the current?

Selecting The First Item In The Treeview Using Code.
Hello, I am simply trying to automatically select the first item within the treeview when the form is first loaded.
Any hints would be appreciated.

Thanks,
Hellboy

Selecting Multiple Objects In Code
as an output, if i want many objects to become disabled can i write the code for:

Image1 - Image78.enabled = false
Text2 - Text 6.visible = true.

Basically, i want to be able to write code for multiple objects that do the same output without having to write:

Image1.enabled = false
Image2.enabled = false
Image3.enabled = false...

etc etc etc.

Cheers

Selecting A Listbox Item Through Code
I have a list box that contains many values. I want to select one of them through code. How do I do this?

Code For Selecting A File And Opening It Etc.
In VB, how is it the code for a user slecting a file to read from handled? In VC ++ there is a COpenFile class. In VB, do I have to make the form used for getting a file from scratch?

[How To] Selecting All Excel Cells From Source Code
Hey,

I would like to select all the cells of my excell sheet from the vb code, anyone can help me?

thanks
P.

Copyright © 2005-08 www.BigResource.com, All rights reserved