A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Simple Question on SafeInspector's RTEEditor



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 25th 06, 05:39 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 5
Default Simple Question on SafeInspector's RTEEditor

Let's say I have this code, which uses the Redemption SafeInspector
library:

Set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
If sInspector.EditorType = olEditorRTF Or sInspector.EditorType =
olEditorWord Then
Set RTFEditor = sInspector.RTFEditor
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8
' here's the question...
' RTFEditor.RTFSelText = ""
End If

....and then there are bunch of calls like

sInspector.SelText = "Some string"

Now, what I'm finding is that "Some string" prints out in whatever
font/size the Outlook email editor is already using. On the other
hand, if I uncomment that RTFEditor.RTFSelText="" line, then subsequent
calls to sInspector.SelText are in the chosen font/size.

Is there something I'm missing here (no surprise!) or is there a
different way of outputting "Some string" I should be using...? This
is Outlook 2003, if that matters.

Thanks!

-S.

Ads
  #2  
Old July 25th 06, 10:04 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Simple Question on SafeInspector's RTEEditor

Why not try first to set the SelText property, and only then set the font
attributes?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
oups.com...
Let's say I have this code, which uses the Redemption SafeInspector
library:

Set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
If sInspector.EditorType = olEditorRTF Or sInspector.EditorType =
olEditorWord Then
Set RTFEditor = sInspector.RTFEditor
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8
' here's the question...
' RTFEditor.RTFSelText = ""
End If

...and then there are bunch of calls like

sInspector.SelText = "Some string"

Now, what I'm finding is that "Some string" prints out in whatever
font/size the Outlook email editor is already using. On the other
hand, if I uncomment that RTFEditor.RTFSelText="" line, then subsequent
calls to sInspector.SelText are in the chosen font/size.

Is there something I'm missing here (no surprise!) or is there a
different way of outputting "Some string" I should be using...? This
is Outlook 2003, if that matters.

Thanks!

-S.



  #3  
Old July 25th 06, 11:47 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 5
Default Simple Question on SafeInspector's RTEEditor

Dmitry Streblechenko wrote:
Why not try first to set the SelText property, and only then set the font
attributes?


Spasiba - ya nis nyiyoo - ya tolka neemnoga panamayoo VBA

Unfortunately, my VBA is about as good as my Russian. Set the SelText
property of...what? I'm just going off the examples on your site -

BTW, the user isn't selecting anything. I'm just trying to paste some
RTF formatted text at the curosr when the macro is invoked.

And in fact, I've now found some cases where my earlier example does
not work perfectly...what is the canonical way to insert text at the
cursor in an RTF-formatted way?

Thanks,

-S.

  #4  
Old July 26th 06, 07:25 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Simple Question on SafeInspector's RTEEditor

Sorry, I meant RTFSelText:

Set RTFEditor = sInspector.RTFEditor
RTFEditor.RTFSelText = "your RTF formatted text here"
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
oups.com...
Dmitry Streblechenko wrote:
Why not try first to set the SelText property, and only then set the font
attributes?


Spasiba - ya nis nyiyoo - ya tolka neemnoga panamayoo VBA

Unfortunately, my VBA is about as good as my Russian. Set the SelText
property of...what? I'm just going off the examples on your site -

BTW, the user isn't selecting anything. I'm just trying to paste some
RTF formatted text at the curosr when the macro is invoked.

And in fact, I've now found some cases where my earlier example does
not work perfectly...what is the canonical way to insert text at the
cursor in an RTF-formatted way?

Thanks,

-S.



  #5  
Old July 26th 06, 09:19 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 2
Default Simple Question on SafeInspector's RTEEditor

Dmitry Streblechenko wrote:
Sorry, I meant RTFSelText:

Set RTFEditor = sInspector.RTFEditor
RTFEditor.RTFSelText = "your RTF formatted text here"
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8


This code::

Set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
If sInspector.EditorType = olEditorRTF Then
MsgBox ("Sorry, you're not in RTF")
Exit Sub
end if
Set RTFEditor = sInspector.RTFEditor
RTFEditor.RTFSelText = "Here is my RTF Text"
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8
sInspector.SelText = "Here is my SelText"

prints

Here is my SelText

in the correct formatting...but it doesn't print "Here is my RTF Text".
It also works ("Here is my SelText" is printed in the correct
formatting) if the the RTFEditor.RTFSelText is set to ""

I'm just not sure it's supposed to be that way

-S.

  #6  
Old July 26th 06, 09:46 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Simple Question on SafeInspector's RTEEditor

I am not sure I understand: the last change wins, i.e. you are supposed to
get "Here is my SelText", *not* "Here is my RTF Text".
Did you expect anything else? Why do you set the sInspector.SelText property
after you set RTFEditor.RTFSelText?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ups.com...
Dmitry Streblechenko wrote:
Sorry, I meant RTFSelText:

Set RTFEditor = sInspector.RTFEditor
RTFEditor.RTFSelText = "your RTF formatted text here"
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8


This code::

Set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
If sInspector.EditorType = olEditorRTF Then
MsgBox ("Sorry, you're not in RTF")
Exit Sub
end if
Set RTFEditor = sInspector.RTFEditor
RTFEditor.RTFSelText = "Here is my RTF Text"
RTFEditor.SelAttributes.Name = "Courier New"
RTFEditor.SelAttributes.Size = 8
sInspector.SelText = "Here is my SelText"

prints

Here is my SelText

in the correct formatting...but it doesn't print "Here is my RTF Text".
It also works ("Here is my SelText" is printed in the correct
formatting) if the the RTFEditor.RTFSelText is set to ""

I'm just not sure it's supposed to be that way

-S.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need a simple question answered.. Roxi Outlook Express 5 July 10th 06 04:12 AM
simple text... ChessNut Outlook - Calandaring 4 May 1st 06 01:54 PM
Fairly simple question about outlook print example Amy Outlook - Using Forms 1 April 6th 06 11:31 PM
Probably a simple problem, but... Terry Outlook Express 5 April 2nd 06 02:12 PM
Need some simple code Dave Neve Outlook and VBA 3 January 15th 06 07:49 AM


All times are GMT +1. The time now is 12:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.