I'm trying to word wrap/wrap text the paragraph I added as a non-editable text field in Xcode 6. I have 'Line Breaking' set to 'Word Wrap' already, but it's still cutting off the text after one line. Is there something else I should be doing?
Solved. Figured out text fields can only be 1 line, so created it as a label instead, set lines attribute to 0, then dragged to size object and word wrap appropriately.
Related
I am very new to VB and am exploring this method to simplify mundane manual work process of highlighting certain text in Powerpoint textboxes.
My intention is for VBA to search for keywords in the textbox, then changes the colour of this line and also a few other lines. e.g. search for the line that contains the word "video", if it returns that line 7 contains this word, I want to change the colour of line 7 and maybe lines 3, 10 and 11 to red colour.
Since your question is generic, We can only give a generic response.
First thing you need to know about VBA in powerpoint for your issue is that you need to access things like objects. You'll first need to access the current Slide and Shape your textbox is in. In this example, Let's assume the textbox you want to access is in the first slide, in the first shape:
Set oTextbox = ActivePresentation.Slides(1).Shapes(1)
With oTextbox
text = .TextFrame.TextRange.Characters.Text 'To access the textbox text.
If InStr(1,text,"some_text")
.TextFrame.TextRange.Font.Color.RGB = [255 0 0] 'To change the color of a textbox.
End If
End With
.TextFrame.TextRange.Characters.Text accesses the shape's text.
To search for a given text in the textbox, you can use the InStr
command to see if the text you want is in your textbox.
.TextFrame.TextRange.Font.Color.RGB accesses the text's color.
This is at least a start for you.
So I got this text of which I can't know the length beforehand because it depends on how many entries there are in an internal table (see below). The table is given to the Smartforms FM in my report. The text itself works fine with a dynamic text variable, but under that text I need a horizontal line. The Line needs to be right beneath the text at all time. So far I only got a line with a fixed position, which does not lead to the result I want.
If it is possible, how can I get the line to change position based on the length of the text? So that it is right under the text at all time, no matter how many lines the text got.
DATA: l_string TYPE string,
lt_stream_lines TYPE STANDARD TABLE OF string.
loop at i_tab.
* reading one line of i_tab into l_string.
APPEND l_string TO lt_stream_lines.
APPEND '' TO lt_stream_lines.
endloop.
CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
EXPORTING
stream_lines = lt_stream_lines
lf = 'X'
TABLES
itf_text = gv_text.
* gv_text then has the full text I want to display
You must have a Main Window containing your Text element followed by a dummy Template element for the horizontal line (one empty cell with the top horizontal border in black color and other borders transparent).
Create a Template element via the context menu:
Draw the border (here I exaggerate the proportions "a little bit"!):
Preview result:
I have Richtexbox with some texts and markup tags, i color it based on the Tags to different colors in form load, coloring of texts/tags works fine,
Problem now is when i tried to replace some Text inside My RTFbox, after coloring, the Color seems to vanish everywhere,
I want to retain all the coloring's i did even after any kind of replacements/Editing's in richtextbox, kindly help
When you delete the text during the replace, you also delete and formatting the text contained. The inserted text will default to whatever style is set for the area it's being inserted. If you want to retain the styling, you will have to get the current styling of the text and save it in memory, and then apply it to the new text you're inserting, something like this:
RichTextBox1.Select(0, 5)
Dim txtStyle As Font = RichTextBox1.SelectionFont
Then you can apply txtStyle to whatever text you're inserting/replacing the old stuff with
Do you know what the command in VBA is in order to space out some text?
I looked on the internet and didn't find anything that would work.
this "SOMMAIRE" textbox has no spacing
and this, is what I want that textbox to look like :
there is more space in between the letters
more exactly, I am looking for the VBA code for this exact button :
Use the shape's .TextFrame2.TextRange.Font.Spacing property. By default it is probably 0. You can change it to other values to increase the font spacing.
Just wanted to add that auto-kerning is also a factor so you'll want to remove that too:
'Set character point spacing to zero
.TextFrame2.TextRange.Font.Spacing = 0
'Remove automatic kerning
.TextFrame2.TextRange.Font.Kerning = False
The kerning property can be viewed manually if you select the shape and in the Font group on the HOME ribbon, click the notch in the bottom right and then go to the Character Spacing tab - you will see a checkbox there where this property is set.
the webapp was already done on office2007 and i need to convert it so it'll work in office2010.
i was able to convert the header generator part of the code but i have problem with the body of the doc itself. the code copy the data from a "data" doc and paste it into the generated doc.
appword.activewindow.activepane.view.seekview = 0
'set appsel1 = appword.activewindow.selection
set appsel1 = appword.window(filepath).selection -that is the original one
appdoc1.bookmarks("b1").select
appword.selection.insertafter("some text")
appsel1.endkey(6) -the code stops here
appword.selection.insertafter("some other text")
the iexplorer debuger says ERROR:appsel1 object required. and when i view its data using the iexplorer debugger its data is "empty" instead of "{...}"
can anyone tell me what i'm doing wrong
if you need more of the code tell me.
From MSDN
After this method is applied, the selection expands to include the new
text.
If you use this method with a selection that refers to an entire
paragraph, the text is inserted after the ending paragraph mark (the
text will appear at the beginning of the next paragraph). To insert
text at the end of a paragraph, determine the ending point and
subtract 1 from this location (the paragraph mark is one character).
However, if the selection ends with a paragraph mark that also happens
to be the end of the document, Microsoft Word inserts the text before
the final paragraph mark rather than creating a new paragraph at the
end of the document.
Also, if the selection is a bookmark, Word inserts the specified
text but does not extend the selection or the bookmark to include the
new text.
So I suspect that you still have no selected text.
I wonder if you can do a Selection Collapse(wdCollapseStart) but that's just a thought.