When I insert a new line into a string that pulls into a table via a docvariable I get a box of sorts. I've tried vbCrLf and Chr(13), both of which work elsewhere but not in the table.
When I insert a new line into a string that pulls into a table via a docvariable I get a box of sorts. I've tried vbCrLf and Chr(13), both of which work elsewhere but not in the table.
The new lines are after LLP and before Oxnard
What can I use for a line feed within a table?
Have you tried Chr(10) & Chr(13)?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
I know but I have noticed that you need to enter it in this particular order (Chr(13) & Chr(10)) for it to work in Access XP and prior Reports. See attached image.
Last edited by Mark Gambo; Jul 2nd, 2005 at 09:13 PM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Alas, I had no luck with Chr(13) & Chr(10). I tried them in reverse just to be sure. Putting a space after the text on the first line at least enables the next line to drop to another line, but the boxes still appear.
In Word, in the document, I have inserted a docVariable field into a table. The table alignment is left with no text wrapping & standard margins. It is set to auto-resize to contents. The row is allowed to break across the page & there is no border. Am I leaving out anything that might be pertinent?
In the code I have created a string then assigned that string to the value of the docVariable:
Code:
Dim OptExecOO As String
OptExecOO = "Nordman Cormany Hair & Compton LLP " & Chr(13) & _
"1000 Town Center Drive, Sixth Floor " & Chr(13) & _
"Oxnard, California 93030"
'ActiveDocument.Variables.Add Name:="OptExec", Value:=" "
If ExecOutOpt.Value = True Then
ActiveDocument.Variables("OptExec").Value = OptExecOO
Else
ActiveDocument.Variables("OptExec").Value = OptExecIO
End If
"1000 Town Center Drive, Sixth Floor " & Chr(13) & Chr(10) & _
"Oxnard, California 93030"
Me.Text0 = OptExecOO
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
For some reason none of those solutions are working for me in a Word 2003 table. They work fine elsewhere in the document. Part of it seems to be related to the font. We use Century Schoolbook. When I change the font the box looks more like a hidden box, but it still consumes a space on the line before the start of the text as opposed to at the end of the preceeding line where it would not take up space.
For the time being I have added spaces between the text to force it to wrap at the margin.
Where exactly is the string coming from? Are you sure it doesn't have the box character in it before you go pasting it into the table?
Otherwise try Chr(11) to add a soft-return?
I declare a string in the User Form code, then set its value directly within the code, i.e.
Dim problemString As String
problemString = "Nordman Cormany Hair & Compton" & Chr(13) & _
"etc..."
So it's not pulling from anywhere else. I haven't tried Chr(11) yet. I will do that and respond accordingly.
Can you post a sample project?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Alas, I had no luck with Chr(13) & Chr(10). I tried them in reverse just to be sure. Putting a space after the text on the first line at least enables the next line to drop to another line, but the boxes still appear.
In Word, in the document, I have inserted a docVariable field into a table. The table alignment is left with no text wrapping & standard margins. It is set to auto-resize to contents. The row is allowed to break across the page & there is no border. Am I leaving out anything that might be pertinent?
In the code I have created a string then assigned that string to the value of the docVariable:
Code:
Dim OptExecOO As String
OptExecOO = "Nordman Cormany Hair & Compton LLP " & Chr(13) & _
"1000 Town Center Drive, Sixth Floor " & Chr(13) & _
"Oxnard, California 93030"
'ActiveDocument.Variables.Add Name:="OptExec", Value:=" "
If ExecOutOpt.Value = True Then
ActiveDocument.Variables("OptExec").Value = OptExecOO
Else
ActiveDocument.Variables("OptExec").Value = OptExecIO
End If
Hi,
The problem not ur script but MS Word template, for Word 2000 & 2003 u need to Place an Enter Key(new line) under the {DOCVARIABLE "YOUR_FIELD_NAME" \* MERGEFORMAT} field if ur field is in the table. If it's not in the table it's ok u wont see the square box.
I found a bug, If u don't add enter key under the "DOCVARIABLE" field & after u exported the data into the "DOCVARIABLE" field u will see the square box & if u place u cursor under the "DOCVARIABLE" field press Enter Key BOOM!!! ms word crash.