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




Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser


Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);

var w = elem.offsetWidth;
var h = elem.offsetHeight;

var l = 0;
var t = 0;

while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}

return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);

var w = elem.offsetWidth;
var h = elem.offsetHeight;

var l = 0;
var t = 0;

while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}

return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x

Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y

For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
    var elem = document.getElementById(elemId);
    
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
    
    var l = 0;
    var t = 0;
    
    while (elem)
    {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }

    return {"left":l, "top":t, "width": w, "height":h};
}

Trying by vb6 in webbrowser

Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document

For x = 0 To doc.getElementsByTagName("a").length - 1

Set elem = doc.getElementsByTagName("a")(x)


I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id

To while loop, but I can't figure it out how

While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend

Next x

How Can I Obtain The Screen Position Of A Webbrowser Element?
I have one element of the webbrowser document, an I need to draw the border of this element in the screen so I need know its position. How can I do in Visual Basic?

Thanks

Absolute Position?
Ok back to my datacontrol thing... now I have the record count total but I want to know what record the user is on when they press forward, back, move first, or last in the data control. I have this

Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub

but the absoluteposition seems to return random things... such as 3 when the text box really displays record 0 and 2 when its really on record number 4. ... am I using this wrong?

complete code


Code:
Option Explicit
Dim rs As Recordset
Dim tCnt As Integer
Dim myPos As Integer

Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub

Private Sub Form_Load()
CommonDialog1.ShowOpen
Data1.DatabaseName = CommonDialog1.FileName

'Set rs = .OpenRecordset("AUTHORS")
Data1.RecordSource = "branch"
Set Data1.Recordset = rs
Data1.Refresh ' Open the recordset
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Text1.DataField = "branch_name"
tCnt = 1
End Sub

Absolute Position
Hello...
what the different between selbookmark and absolute position in datagrid...?
i can get the current pointed recordset with that two, can't i ?

how if i do a multiple select ? how absolute position works in multiple select?

thanks,
ganero

.Absolute Position
I have a code errors out telling me I have an invalid key. The code it errors on is as follows:

Do While Not rs.EOF

.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number
rs.MoveNext
Loop

(it errors at the .ADD rs line)
I can't find any help on the invalid key error. Anyone have any suggestions?
Thanks
Pat

Absolute Position
I am trying to use rs.absoluteposition to keep incrementing the count on a label, but this always seems to stay at -1. Any ideas?

Thanks!
Erica

Absolute Position In A Query
Hi, using DAO and Access, is there a way to know the exact position of a record in a query ? Like absolute position or something ?
Many Thanks

Absolute Position Of A Record !!!
Friends,

How can I view the number of exact row in a label that is currently showing the data.

Something like this: Record 15 of 75

Help needed please.

Absolute Control Position
ok i want a function 2 find the absolute position of a control on the form.... for example if the control passed in is in 2 pic boxes it will return the twirps to the top left of the form

- i will be doing this kinda thing abit so i need a generic function -

thanks kris

Absolute Control Position?
How can I know the absolute position of a control on a
form, using the upper left corner of the form as 1,1

These controls may be put inside other controls (nested)!

Would anybody help?

Any hint?

Thanks

Absolute Cell Position
Is there any way of obtaining the absolute pixel position of a CELL so that I can use the AddShape position to draw a shape in that cell of equal size and position of that cell?

ie. AddShape(msoShapeOval, Cell.Top, Cell.Left, Cell.Height, Cell.Width)
'Kind of thing'

Many Thanks in advance.
Riyaz

Absolute Position In Data Reports
How can you print out an ordered sequence to number the records in a VB data report? The function control won't go into the detail section, and calculated fields only work if you have other fields to calculate from. It seems so easy in Access (number grouping), but why not in VB? Any ideas?

Record Count And Absolute Position
On my form I'm trying to display the number of recoreds in my Access DB and also the current position I'm at but I'm having no luck. Currently i'm using the below but I keep getting -1 of -1 displayed. Can anyone see what is wrong?

Thanks


Code:
strCn = ConnectString()

sSQL = "SELECT * FROM tblBuy ORDER BY Completed DESC, Date DESC"
Set rsEditBuy = New ADODB.Recordset
rsEditBuy.Open sSQL, strCn, adOpenDynamic, adLockOptimistic

lblTrades.Caption = rsEditBuy.AbsolutePosition & " of " & rsEditBuy.RecordCount

Absolute Character Position In Richtext Box
I am trying to auto generate some text in a richtext box. Characters will have different sizes and be of different widths.

I need a way to line up the tabs inbetween things. Sometimes I need 2 tabs, but most of the time I only need 1 inbetween things (Sorry if this is vauge, I will attach an example if needed).

The only way I can think of accomplishing this is by testing the absolute position of a character from the line above and if absolute position of the current character matches that then leave the tabs how they are, otherwise add a tab until the tabs line up.

I searched through the object browser for a good hour testing all the different properties of the richtext lib, and nothing worked. SelTabs looked promising but it always returns 0 for some reason.

Any ideas?

ADO Record Count And Absolute Position
I finally figured out how display the record count of a table or query as well as the absolute record being focused on, but I am getting eroneus numbers -1 of 26 and when I click on the right or left arrow the counter wont increment (or decrement) unles I click the arrow twice. I put the statement in the form load:

Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount

and then I put it under the click sub for the Adodc1 control:

Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount
End Sub


Any suggestions on how I can get the proper results? Also when a query is run and produces no results, I would like the "counter" to display 0 of 0 instead of -1 of 0 and the control seems to be shaded like Enabled = False. DAVE

Visio - How To Move Shape To Absolute Position?
Hi,

Thanks for taking the time to look at my post.

I would like to move a shape object to an absolute location of my choice, e.g. I would like to know how to move a shape object to position (100, 100).

The selection object's move method only allows the selection to be moved relative to where it's original position was.

here is the code:


VB Code:
Sub start() Dim aShape As ShapeDim aSelection As Selection Set aShape = Documents(1).Pages(1).Shapes(1) ActiveWindow.Select aShape, visSelect Set aSelection = ActiveWindow.SelectionaSelection.Move 2, 2 'i want to move to an absolute location, not just 2 up and 2 right like this line doesEnd Sub


Thanks for your time
<>GT<>

Getting The Absolute Position Of A Control Without Knowing Its Parent
Is there anyway to get the screen coords of a control that doesn't have an hWnd and if you don't know its parent control? I am trying to work on a class and I need to know the top and left of a control relative to a screen (not the window) without passing an hWnd.

Absolute Position A Text Box In Word Macro ??
Hi Guys

Wondering if anyone can tell me if its possible (and how to) absolute position a text box in a word macro....

I have a word document that runs a macro that places a text box on the page containing a barcode. The word document contains text that is editable by the user. However, if the user edits the text, the text box moves as if it is set to position relative to the text. I need the text box to remain in the absolute same spot all the time.

Please, any info on this would be much appreciated.

Nick

Finding Absolute Path
Hi,
Is there any way to find absolute path of Access db from VBA?
API call is ok.
I need to find the full path of current folder where access db is stored.

thanks,

Server Side Cursor Recordset Absolute Position
I apologize in advance for this one since I have seen a solution for this some time ago, but cannot seem to turn it up in a search.

 I am using a server side cursor (This will be an advantage for several reasons, so I will not want to change this).

 I only need to determine the recordset absolute position and the recordset count so I can display "Record 1 of 25" or whatever.

 I do a move last then a move first, but still receive the values of -1 for both absolute position and count.

I am using VB6 with SQL Server 7 ADO connection

Terry (cyberbiker)

Absolute Control Of The Screen
Hi Guys,

Please I writing a program that puts a shield on computers runinng in a public place. I need this program to bar access to the screen until users enter valid codes to unshield the systems and let them use these computers. The program is running well except that when people start playing certain games that invoke certain screen modes, the shield becomes ineffective, and can't bar them from using the computers.

Please using VB, how can I make my shield have priority of all screen modes.

Thank you

Webbrowser - Open Links From Excel/powerpoint Within The Same Window (ie Webbrowser)
I am working on a custom browser using the webbrowser control.

When I open powerpoint or excel documents within the webbrowser and when I click on a link in them, I want to open the resulting page in the same window (ie. within the webbrowser control) instead of launching a new instance of default browser. How can do this ?

TIA

What Is The Correct Way To Implement Absolute Positioning In The Webbrowser Control?
I use a toolbarbutton to do this:

htmdoc.execute "AbsolutePosition", false
htmdoc.execute "2D-Position", false

(i have first set htmdoc = web.document etc. web is my webbrowser control's name.)

It works when inserting a new element - but when i insert subsequent elements or objects the button seems only to affect the first thing i inserted - or to behave oddly by switching the first object inserted between its final position and the relative position it started with. Other components inserted afterwards usually ignore the command - but sometimes by clicking about the window - i get them to work - whats going on?

Thanks in advance!

 

Edited by - scott_p on 9/22/2002 3:49:15 AM

Finding Image Links...
How would you check a html document and find all the image links? this has really confused me as i cant work out how to do it because all the image links are different lengths, so i need it to check the first 4 characters and see if they equal "<img" i can do this but then i need it to add all the other characters to the link untill it gets to the next ">" character and this confused me...

writing that has just given me an idea. hehe but please post an answer as my idea is probably wrong.

Finding Cells With Links In Excel
Heyas

Anyone know how I can run through a workbook in Excel 2k and test each cell if its value is a link to another workbook??

Have broken links and the file is too big to find it.

Deleting the links is the last option

If I could somehow findthe initial 2 chars of the link function ie =[
Then I think Im half way there but how can I compare a function syntax instead of the actual value visible in the Cell??

Many thanks for any insight

CandyMan

NEVER MIND

If Left(CStr(ActiveCell.Formula), 2) = "=[" Then
MsgBox "Match"
End If

Can start with this...

Code For Finding Broken Links
I am looking for a code to find broken links from a web site. Does anyone know how do do this?

Finding Windows Version, Screen Resolution && Screen Size
Hi there

Just a quickie!

Is there anyway I can find out what version an operating system, screen resolution and screen size, a certain computer has got during run time??? If so, whats the code???

Thanx in advance

Links &gt; Webbrowser?
You know how when you drag over a link in IE and it tells you the webpage on the status bar. Well I was wondering how I could get a label to do that?

HTML Links In VB About Screen?
How do you add HTML links (company web site URL, mailto) to a Visual Basic 6 "About" Screen?

WebBrowser Links Opening
Instead of clicking on a link in the browser and it opening the page, can you click on a link that will send the link name to a specific text box? Does someone have an example they can show me?

Thanks for help

[Not Resolved] Webbrowser Links?
Hi guys.... I searched the forum but I didn't find the answer... So I post this question: How can I extract all the links in a webbrowser when the HTML page has frames?
I tried to look at Webbrowser.Document.Links.Length but it returns zero, and I can't find a way to access the same property in the frames!!!
Thanks,
Xmas.

How To Get All The Links Of A Web Page Without Using Webbrowser Control
Hello,
I want to get all the links of a webpage without using webbrowser control. Is there any way doing that? Please help...

Collecting And Listing All Links In Webbrowser
How could I list all links that are on the page into List1?

List1.AddItem WebBrowser1.Document.links ' This grabs the first link

Text1.Text = WebBrowser1.Document.links ' This lists ALL links, even the logout one which is undesired...

How can I gather several specific links?

WebBrowser - Show Links In Status Bar
I want it so when the user places the cursor over a link, it shows the link shortcut in the statusbar

thanks

Extracting Links Within A Webbrowser Control
I have a webbrowser control that navigates to a page on an online game (http://www.outwar.com/rankings.php?t...=400&submit=go) and i want to be able to extract all the player names and links on that. I think i could probably use the inet control to get the source code and parse it, but that would take me damn well near the rest of my life to do, so im wondering if i can get the links and names off using the webbrowser control and add them to a listbox.

Webbrowser Control (how To Retrieve Links)
I am using the webbrowser control in VB. I was wondering if there is any "trick" for visualising, or somehow retrieving all the links from the actual web page? And by links I don't mean the content, but only the url itself, of course.

I thought about making a loop, sending the TAB key with the sendkeys function and look at the statustext variable.

Any better solutions?

Open All Links From Webbrowser Into A New Window?
how can i acheive this? xome of the links that i surf cause my webbrowser to screw up and go full screen, so how can i make all the links open in a new window, not in my program...

Stop Dragging Links From Webbrowser Control
Hi all,
i'm creating a securelink browser application using
WebBrowser cotrol in VB6.
Our requirment is that no one can't do drag and drop
a hyperlink out side the application ,as one can do
with other browsers.
so how can i do this ,plz help me.

Thanks

How Can You Get A List Of Images On A Webpage, With Their Links In A Webbrowser Ctrl?
In a webbrowser control, you can get a list of all links by the code
VB Code:
For x = 0 to WB.Document.links.length - 1msgbox WB.Document.Links(x).srcNext
and you can get a list of images with
VB Code:
For x = 0 to WB.Document.images.length - 1msgbox WB.Document.images(x).srcNext
but how can you get a list of images and the links they link to (if any?)

Finding Position In Song
i am using the mcisendstring to play music but i want to find out where in the song i am. i am able to find the length but i do not know how to find where i am in the song. Is there an api call or do i have to code it by checking when the song changes and using the timer function to clock the difference between when it started and the present time

Amazing Problem. I Cant Get Links From Webbrowser Control When My Program Is Compiled
Hello,
I am trying to retrieve all the links from a web page. I am using webbrowser control for that. I create references of the Microsoft HTML Object library. I used 3 methods. And all of them works fine when i run the program within visual basic code window. But as soon as i create .exe it does not work and show me the error 'Object variable of with block variable not set' (error : 91)
Here is my code.

Method 1:

Code:
Dim doc as New HTMLDOCUMENT
Dim a_link As HTMLAnchorElement

wbrsource.navigate("www.bdlearner.qsh.es")

'Give time to webbrowser for loading document

do while wbrsource.readystate<>readystate_complete
doevents
loop

'Document loading completed. Extract links

Set doc = wbrSource.Document
Set a_link = doc.links

For Each a_link In doc.links
List1.AddItem a_link.href
Next a_link
Method 2:

Code:
dim collinks as variant
wbrsource.navigate("www.bdlearner.qsh.es")

'Give time to webbrowser for loading document

do while wbrsource.readystate<>readystate_complete
doevents
loop

'Document loading completed. Extract links

Set collinks = wbrSource.Document.All.tags("A")

For qq = 0 To collinks.Length - 1
List1.AddItem collinks(qq).href
Next qq
Method 3:

Code:
wbrsource.navigate("www.bdlearner.qsh.es")

'Give time to webbrowser for loading document

do while wbrsource.readystate<>readystate_complete
doevents
loop

'Document loading completed. Extract links

For qq = 0 To wbrSource.Document.links.Length - 1
List1.AddItem wbrSource.Document.links(qq).href
Next qq
I tried all 3 methods. But none works when the code is compiled into .exe.

What can i do now? I need a solution. I am using Microsoft Internet Explorer (Version: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158)

Please help me.

Kindest regards...
Shaoun

Finding Cursor Position In Text Box
I have a VB6.0 Form application where I build HTML in a textbox on the form that the user can see and edit by clicking buttons (to insert HTML codes), plus directly edit (to add their own text behind an HTML code.

Any thoughts on what would be the easiest way to programatically identify where the input position (cursor) is in the textbox (where the user last mouse-clicked in the box)?

Thanks,
Mark

Finding Character At Curser Position
Hi
I have a program that highlights sections of text and then copies it, pastes it into a different document, [written in word macros]

trying to find the best way to let the program know when to stop highlighting
i want to specify that when the font is bold and when the character under the curser is ":" then stop

but i dont know how to look at the character under the curser

i was looking at

Code:
Selection.Character.Item(x)
but that only gives me the character at postion x in relation to where i began to highlight,
is there a command in word macros that will return the number of characters that are currently highlighted
if i had that command i could use it to specify a number for the command above
*****************NOTE*****************************
i dont want to use a counter to increament each letter highlighted as my program highlights large and small sections of text, it highlights one line at a time until the font changes then moves back one line
at this point and at only this point will it highlight one character at a time so i DO need a command that returns the amount of characters highlighted

code that highlights is shown below

Code:
Sub EOL(x As Integer, y As Integer)
'//HIGHLIGHTS TEXT UNTIL IT REACHES THE NEXT SECTION AND COPIES
'//IT HIGHLIGHTS THE TEXT UNTIL THE SIZE OR THE FONT CHANGES
'//THEN IT COPIES THE HIGHLIGHTED TEXT
Dim size As Integer
Dim Bold As String
Dim test1 As String
Dim ResultCount As Integer

Windows(SourceBox.Text).Activate

'*************************************************************POSITIONS CURSER TO BEGIN HIGHLIGHTING
Selection.MoveRight unit:=wdCharacter, Count:=2
Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend

'**************************************************************READS CURRENT FONT
Bold = Selection.Font.Bold
size = Selection.Font.size

'**************************************************************HIGHLIGHTS 1 LINE AT A TIME UNTIL FONT CHANGES
'**************************************************************Y = 0 SPECIFIES THAT IT IS NOT THE LAST ENTRY TO BE FOUND
If y = 0 Then
Do Until (Selection.Font.Bold <> Bold Or Selection.Font.size <> size)
Selection.MoveDown unit:=wdLine, Count:=1, Extend:=wdExtend

Loop

'***************************************************************MOVES UP ONE LINE TO WHERE FONT IS THE SAME
Selection.MoveUp unit:=wdLine, Count:=1, Extend:=wdExtend
Bold = Selection.Font.Bold
size = Selection.Font.size

'****************************************************************HIGHLIGHT 1 CHAR AT A TIME UNTIL FONT CHANGES
Do Until (Selection.Font.Bold <> Bold Or Selection.Font.size <> size)
Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend

Loop

'****************************************************************MOVES BACK ONE CHAR TO WHERE FONT IS THE SAME
Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
End If


'****************************************************************Y = 1 SPECIFIES THAT IT IS THE LAST ENTRY IN THE TABLE
'****************************************************************MOVES DOWN UNTIL IT FINDS THAT THE FONT HAS CHANGED
If y = 1 Then
Do Until (Selection.Font.Bold <> Bold Or Selection.Font.size <> size Or Selection.Text = vbCr)
Selection.MoveDown unit:=wdLine, Count:=1
Loop

'*****************************************************************MOVES LEFT ONE CHARACTER
'*****************************************************************MOVES BACKWARDS UNTIL ONE OF THE SPECIFIED CHARACTERS IS ENCOUNTERED
Selection.MoveLeft unit:=wdCharacter, Count:=1
Selection.MoveUntil cset:="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.,;", Count:=wdBackward

'*******************************************************************MOVES UP HIGHLIGHTING UNTIL FONT CHANGES
Do Until (Selection.Font.Bold <> Bold Or Selection.Font.size <> size)
Selection.MoveUp unit:=wdLine, Count:=1, Extend:=wdExtend
Loop

'*********************************************************************MOVES DOWN ONE LINE
Selection.MoveDown unit:=wdLine, Count:=1, Extend:=wdExtend
Bold = Selection.Font.Bold
size = Selection.Font.size

'**********************************************************************MOVES LEFT UNTIL FONT CHANGES WHILE HIGHLIGHTING
Do Until (Selection.Font.Bold <> Bold Or Selection.Font.size <> size)
Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
Loop

'***********************************************************************MOVES RIGHT ONE CHARACTER
Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
End If

'**********************************************************************IF IT IS COPYING THE TITLE CHANGE FONT SIZE TO 12
If x = 0 Then
Selection.Font.size = 12
Else
Selection.Font.size = 10
End If

'*******************************************************************COPY SELECTED TEXT
Selection.Copy

End Sub

Finding Button Position For (setcursorpos)
I have finaly found out how to position the cursor position using.

setcursorpos.

By doing the following


Code:
Private Declare Function SetCursorPos Lib "user32" _
(ByVal x As Long, ByVal y As Long) As Long
'place code above, at top

SetCursorPos 500,500 'place this on a button or what ever and it will position your cursor to 500,500.

This code is great one slight problem how do you find out a position of a button in pixels so when you change the screen resolution, the cursor is not in a total different place?

Finding Exact Position In WMV-file
I'm using the MCI API to play media files in my application. I've implemented a slider that shows the current position of the media file while playing. When a user manually scrolls the slider, I use this command to move the media to the correct position:

mciSendString("seek " & AliasName & " to " & to_where, 0&, 0&, 0&)

This works fine with all kind of file types as long as the media file is located on my hard drive, but I can't get it to work when I stream a WMV-file from a server. The command returns with no errors, but the command has no effect. The media file's position is the same as it was before the MCI command.

The strange thing is that it seems to be working when I stream MP3-files from the same server. Why doesn't it work with WMV-files?

Finding Font Position + Word (VBA )
Am in need to find the actual font position in ms word (2003-Professinal).

Finding The Position Of A Character In A String
Hi All,

I'm creating a boot switcher program.

The current code:

Private Sub mnubootnowxp_Click()
Dim Xx As String
List1.Clear
Close #3
Open "c:oot.ini" For Input As #3
Do While Not EOF(3)
Line Input #3, Xx
List1.AddItem Xx
Loop
Close #3


For K = 0 To List1.ListCount - 1
Dim sstring2 As String
If InStr(44, List1.List(K), "XP") = 0 Then

Else
Text2.Text = Left(List1.List(K), 43)
WriteINI "boot loader", "default", Text2.Text, "c:oot.ini"
Exit Sub

End If

Next

End Sub


starts looking from the 44th character in the line below (which is the equal sign) for the string "XP"


multi(0)disk(0)rdisk(0)partition(5)WINDOWS="Microsoft Windows XP Professional" /fastdetect


and then takes everything from the left of the equal sign and copies it to the default= (shown below)



[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(5)WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(5)WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(4)WINNT="Microsoft Windows 2000 Professional" /fastdetect
C:="Microsoft Windows"


so the code is starting from the 44 position and taking everything to the left (43 position) which works fine. But, if a user has named the WINDOWS folder to a longer or shorter name, my code won't read the correct amount of characters to copy up to the default= line.

So can someone please tell me how to read the equal sign, get it's position and then read everything from the left of the equal sign.


Thanks,

Techsent

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