473,480 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RTF2 Report (across multiple pages)

How can I make sure that the page doesn't cut off the rest of my line
or image?

Right now it prints an image toward the bottom of the page and cuts
that image in half and places the rest of it on the next page.

Then I modified the document to place the image higher. Now it takes
the text from the last line of the first page (shown correctly and
fully on the previous page) and shows the bottom half of that sentence
on the next page.

Yes, I'm using the supplied code to deal with this but it's not
working like I expected.

Christian

May 25 '07 #1
9 2106
And I guess while I'm asking this - how is SelStart used?

I'm attempting to use it to paste text. I use the same code in a memo
text box, so I know it works. It seems that there's a discrepancy
between where it says the cursor is and where it actually is with the
underlying formatting.

The result is that I can't simply add an offset to the location and
expect it to appear at the correct position all the time.
Christian

May 25 '07 #2
For posterity (responding to myself):

In order to get the pages to print without cutting text off across
pages I simply made each record as a page in the document.

I still have no solution for dealing with SelStart in the document.

The code worked on a text box but doesn't with RTF2:
----------------
Private Sub List3_Click()
On Error Resume Next
Dim sdd As String
Dim rgt As String
Dim lft As String
Dim QWE As Integer

If LostFocusPos = 0 Then
QWE = BeforeUpdatePos
Else
QWE = LostFocusPos
End If

sdd = Me.RTF22.Text

lft = Left(sdd, QWE)
rgt = Right(sdd, Len(sdd) - Len(lft))
Me.RTF22.Text = lft & "«" & Me.List3 & "»" & rgt

End Sub
-------------------

There are numerous formatting fields that SelStart seems to ignore.

Christian

May 29 '07 #3
Lets' go back to the start on your SelStart issue. What is it you need to do
at runtime using the SelStart method?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<ch************@yahoo.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
For posterity (responding to myself):

In order to get the pages to print without cutting text off across
pages I simply made each record as a page in the document.

I still have no solution for dealing with SelStart in the document.

The code worked on a text box but doesn't with RTF2:
----------------
Private Sub List3_Click()
On Error Resume Next
Dim sdd As String
Dim rgt As String
Dim lft As String
Dim QWE As Integer

If LostFocusPos = 0 Then
QWE = BeforeUpdatePos
Else
QWE = LostFocusPos
End If

sdd = Me.RTF22.Text

lft = Left(sdd, QWE)
rgt = Right(sdd, Len(sdd) - Len(lft))
Me.RTF22.Text = lft & "«" & Me.List3 & "»" & rgt

End Sub
-------------------

There are numerous formatting fields that SelStart seems to ignore.

Christian
May 29 '07 #4
On May 29, 5:01 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
Lets' go back to the start on your SelStart issue. What is it you need to do
at runtime using the SelStart method?
I have a list box of the fields in a selected table or query. When I
place the cursor in the RTF and click on a field in the listbox I want
the fields name (with brackets) placed where my last cursor position
was.

I'm basically making a mail merge field inside access. I then have a
routine that finds the field and replaces it with the field value of
the selected record.

Thanks,

Christian
May 29 '07 #5
It's been years since I wrote this but I think you would use the SelText
prop. THe last place you clicked in the control is automatically the current
insertion point. If that does not work then just do a GoogleGroups search
on:
RTF control insert text visual basic

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<ch************@yahoo.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
On May 29, 5:01 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
>Lets' go back to the start on your SelStart issue. What is it you need to
do
at runtime using the SelStart method?

I have a list box of the fields in a selected table or query. When I
place the cursor in the RTF and click on a field in the listbox I want
the fields name (with brackets) placed where my last cursor position
was.

I'm basically making a mail merge field inside access. I then have a
routine that finds the field and replaces it with the field value of
the selected record.

Thanks,

Christian


May 30 '07 #6
On May 29, 7:23 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
It's been years since I wrote this but I think you would use the SelText
prop. THe last place you clicked in the control is automatically the current
insertion point. If that does not work then just do a GoogleGroups search
on:
RTF control insert text visual basic
Yup, that was it.

Me.RTF22.SelText = lft & "«" & Me.List3 & "»" & rgt

works.

Why it works I don't know, but whatever.

Thank you Steve!

Christian

May 30 '07 #7
On May 30, 10:45 am, christianlo...@yahoo.com wrote:
Me.RTF22.SelText = lft & "«" & Me.List3 & "»" & rgt
It will also work simply as:

Me.RTF22.SelText = "«" & Me.List3 & "»"

Now, if I could set the back color of that text to gray, it would look
just like a ms word merge field, however:

Me.RTF22.SelFontBold = True
Me.RTF22.SelText = "«" & Me.List3 & "»"
Me.RTF22.SelFontBold = False

doesn't work. And certainly:

Me.RTF22.SelFontBackColor = vbBlue
Me.RTF22.SelText = "«" & Me.List3 & "»"

doesn't either.

Christian

May 30 '07 #8
You need to search online for VB code showing you how to accomplish your
task.

Set SelStart cursor position(or accept current cursor position)
Set SleLength(how many consecutive characters will your property mods apply
to).
Set desired formatting props
That's it. You just have the order of implementation incorrect.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<ch************@yahoo.comwrote in message
news:11*********************@m36g2000hse.googlegro ups.com...
On May 30, 10:45 am, christianlo...@yahoo.com wrote:
Me.RTF22.SelText = lft & "«" & Me.List3 & "»" & rgt
It will also work simply as:

Me.RTF22.SelText = "«" & Me.List3 & "»"

Now, if I could set the back color of that text to gray, it would look
just like a ms word merge field, however:

Me.RTF22.SelFontBold = True
Me.RTF22.SelText = "«" & Me.List3 & "»"
Me.RTF22.SelFontBold = False

doesn't work. And certainly:

Me.RTF22.SelFontBackColor = vbBlue
Me.RTF22.SelText = "«" & Me.List3 & "»"

doesn't either.

Christian
May 31 '07 #9
On May 30, 7:41 pm, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.comwrote:
You need to search online for VB code showing you how to accomplish your
task.

Set SelStart cursor position(or accept current cursor position)
Set SleLength(how many consecutive characters will your property mods apply
to).
Set desired formatting props

That's it. You just have the order of implementation incorrect.
Yes, I found that out. It's hard to find examples though.

Now I know how to make the selection bold, italics and change the font
size. What is not working are the selection colors:

Me.RTF23.SelText = "«" & Me.List6 & "»"
Me.RTF23.SelStart = Selection
Me.RTF23.SelLength = Len(Me.List6) + 2
'Me.RTF23.SelFontItalic = True 'WORKS
Me.RTF23.SelBackColor = vbRed 'DOES NOT WORK

No big deal. I'm currently working on the find/replace code to
substitute the fields with records. I wanted the Replace function to
work but I might have to use the RTF2 Find function.

Christian
May 31 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3385
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
4
2505
by: Marion Neubauer | last post by:
Hi! I'm using the RTF2 Control from Lebans web site with MS Access 2000. It's working very good. Now i want to create a letter with the formated text of the RTF2 control in MS Word 2000, but it...
3
3295
by: Phil Stanton | last post by:
I am trying to produce a program that will output any Access report to an editable Word document. So far it is working well but slowly with text boxes, labels, and lines. I now need to try to...
1
1861
by: dan.roffman | last post by:
Is there a way to span a report over multiple pages. I think you could do something like count the number of lines and if it exceeds a certain number, then put the rest of th text into another RTF...
11
4725
by: D Perron | last post by:
I am using the RTF2 activeX control from Stephen Leban's website and it works really well when there is one memo field. However, I cannot get it to work with multiple memo fields (I have 4). I...
0
5341
by: ghadley_00 | last post by:
MS Access Create form / report with multiple pages using different background images Hi, Would like to have users fill out a multipage form, and then click a print button, which pulls up the...
1
1927
by: Stinky Pete | last post by:
Evening, I have a form that uses 5 pages (it's an electronic copy of the paper version) we are going to use for manufacturing non conformances and product deviations. In case your wondering,...
2
3112
by: Pascal Hagedorn | last post by:
I downloaded Steve Leban's RTF2 control and it shows me the report as wanted. The Problem is, if i want to print it, it comes a PopUp where it says "properties write protected" (german:...
1
3273
by: replyrpatil | last post by:
What I am trying to do: I need to print a compact access report (font 6 size) created using RTF2 program developed by Stephen Lebans to generate a TIF image of custom size (5.5 in x 2.0 in) ...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.