So in this screenshot I would like to do a line search to find a specific text which will be CON- from the "Mfr part number" column, once it finds it I would like for it to highlight the line. I am having a difficult time trying to figure which way to approach this. The line of code that does highlight the line is below. Any help would be greatly appreciated.
sapsession.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG").getAbsoluteRow(2).Selected = True
Related
See my screenshot:
In the pic, I am trying to retrieve the highlighted line but unable to do so.
Can someone help me with this and some vba code?
I am trying to create a macro that will search for a single character and perform a specific action based on whether or not the character is at the end (do nothing) or beginning (do something) of a line.
In my quest to find how to do this, I've seen plenty of documentation for determining if the text is at the beginning or end of a document or page or paragraph or on a specific line, or its position in a cell, but nothing about the columnar (I assume)position relative to a line of text.
Does anyone know if such an animal exists?
Thanks in advance!
Selection.Information(wdFirstCharacterColumnNumber) will give you the position of first character in the selected text relative to the line. Is this what you are searching for?
I have to format a text based on indentation.
The steps are :
User selects a table on a page
Presses a button
The table gets indented exactly as the text above ( no gaps at all)
I know MSFT gives little less indentation to the table, so they look little askew.
I know how to change the indent of the selected table by the command
Selection.Tables(1).Rows.LeftIndent = <Value_as_that_of_the_text_above>
but I don't know how do I get the indentation of the text above, considering only table has been selected not the text above. Any help is appreciated.
You will need to get all the paragraphs of the document(try this). Then get the last paragraph on the page indent.
I am writing a script in VBscript and I need to include line breaks or carriage returns. I was using the following code:
objSelection.TypeParagraph()
But this creates to big of a space between lines. The best way I can think to explain it is, when you are in Microsoft word, and you type a line, if you were to press Shift + Enter, you would get two separate lines close together, whereas pressing just Enter will do a full Carriage return (which I don't want). I will demonstrate here.
How can I achieve the same result as 'Shift + Enter' but through VBscript?
Thank you very much.
Assuming you're asking about Word VBA, you can do it like this:
objSelection.TypeText(Chr(11))
Generally, if you can't find out how to do something in VBA that you can do in the application, just record a macro while you perform the required steps and then look and see what VBA has been generated.
I am writing data into an excel spreadsheet. The data comes from an Access Database. Code like the line below works:
xl.cells(5,5)="joe"
but code like the line below does not:
xl.cells(5,5)="1/2CD438"
I get an error like "Application defined or object defined error"
I think Excel is trying to do a calculation, and the calculation fails. All I really want is the text string.
I've tried formating the column like
columns(1).NumberFormat="#"
, but it doesn't work either.
Any ideas?
Thanks for all the input. I had tried several of your ideas without success. As it turns out I was using variables to determine the exact row, column as:
xl.cells(NextRow, Col) = ars!PartNo
By simply replacing NextRow with an integer, the code worked. Replaced the integer in the test with NextRow, and the code ran. I suspect a misspelling or something, but couldn't see it looking at the code.
Thanks for the suggestions.