PC Review


Reply
Thread Tools Rate Thread

change font size of incoming emails

 
 
Andreas
Guest
Posts: n/a
 
      28th Sep 2010
Hi,

I'd like to change the font size of incomming HTML-emails by using
VBA. In fact not only the display size but the letter's size e.g. when
printed...

First of all:
Is that possible???

And if yes, how would on implement that?

There is no problem to read out the .SenderEmailAddress, .EntryID and
so on.
But how can I change the size of any letter in a email e.g. to 11pt?

Thanks for any answer in advance,
Andreas
 
Reply With Quote
 
 
 
 
Ken Slovak
Guest
Posts: n/a
 
      5th Oct 2010
What version of Outlook? If this is 2007 or later or WordMail with any
earlier version you can use the WordEditor object of the Inspector for a
mail item to get the Word.Document object. WordEditor is Word.Document. From
there you can just use Word object model code to change the font.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andreas" <(E-Mail Removed)> wrote in message
news:440ec01f-087c-4397-8110-(E-Mail Removed)...
> Hi,
>
> I'd like to change the font size of incomming HTML-emails by using
> VBA. In fact not only the display size but the letter's size e.g. when
> printed...
>
> First of all:
> Is that possible???
>
> And if yes, how would on implement that?
>
> There is no problem to read out the .SenderEmailAddress, .EntryID and
> so on.
> But how can I change the size of any letter in a email e.g. to 11pt?
>
> Thanks for any answer in advance,
> Andreas


 
Reply With Quote
 
Andreas
Guest
Posts: n/a
 
      6th Oct 2010
Hello Ken,

On 5 Okt., 16:39, "Ken Slovak" <kenslo...@mvps.org> wrote:
> What version of Outlook? If this is 2007 or later or WordMail with any
> earlier version you can use the WordEditor object of the Inspector for a
> mail item to get the Word.Document object. WordEditor is Word.Document. From
> there you can just use Word object model code to change the font.


That sounds interesting and is the most promising thing I heard in
this context!!!!

I will try this, although it might take some time till I can start
it...
May I contact you, if I have problems with this??

Bye,
Andreas

 
Reply With Quote
 
Ken Slovak
Guest
Posts: n/a
 
      6th Oct 2010
I don't provide private support for anyone except for my clients, who pay
for my time.

If you post questions here, or in an Outlook programming forum such as
http://social.msdn.microsoft.com/For...ookdev/threads, I or
someone else will be happy to answer your questions.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andreas" <(E-Mail Removed)> wrote in message
news:3506ad0d-c085-4320-bfb1-(E-Mail Removed)...
> Hello Ken,
>
> On 5 Okt., 16:39, "Ken Slovak" <kenslo...@mvps.org> wrote:
>> What version of Outlook? If this is 2007 or later or WordMail with any
>> earlier version you can use the WordEditor object of the Inspector for a
>> mail item to get the Word.Document object. WordEditor is Word.Document.
>> From
>> there you can just use Word object model code to change the font.

>
> That sounds interesting and is the most promising thing I heard in
> this context!!!!
>
> I will try this, although it might take some time till I can start
> it...
> May I contact you, if I have problems with this??
>
> Bye,
> Andreas
>


 
Reply With Quote
 
Andreas
Guest
Posts: n/a
 
      18th Oct 2010
The following is what I got now after trial and error typing ;-)

-------------<SNIP>---------------
Sub Schriftgroesse()

Dim objInspector As Inspector
Dim olInspector As Inspector
Dim objDoc As Object

Set objInspector =
Application.ActiveExplorer.Selection(1).GetInspector

objInspector.Activate

Set objDoc = Application.ActiveInspector.WordEditor

With objDoc.Windows(1).Selection
.WholeStory
.Font.Size = 10
End With

End Sub
-------------<SNIP>---------------

By any reason the line
.Font.Size = 10
causes an error which says in German:
"Laufzeitfehler '4605'
Diese Methode oder Eigenschaft ist nicht verfügbar, weil das Dokument
für Bearbeitung gesperrt ist."

In English this should mean
"Runtimeerror '4605'
This method or feature is not available, because the document's
editing is blocked."

How can I solve this problem?

Thank you for answers in advance,
Andreas

 
Reply With Quote
 
Ken Slovak
Guest
Posts: n/a
 
      18th Oct 2010
That sounds like the Document is locked for editing. If you cannot unlock it
you won't be able to use the Word object model on the Document object. If
that won't work then you might have to parse the HTMLBody property and look
for where the font size is defined and change it there using text and string
parsing functions.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andreas" <(E-Mail Removed)> wrote in message
news:97bca26c-78f9-4a5f-b62b-(E-Mail Removed)...
The following is what I got now after trial and error typing ;-)

-------------<SNIP>---------------
Sub Schriftgroesse()

Dim objInspector As Inspector
Dim olInspector As Inspector
Dim objDoc As Object

Set objInspector =
Application.ActiveExplorer.Selection(1).GetInspector

objInspector.Activate

Set objDoc = Application.ActiveInspector.WordEditor

With objDoc.Windows(1).Selection
.WholeStory
.Font.Size = 10
End With

End Sub
-------------<SNIP>---------------

By any reason the line
.Font.Size = 10
causes an error which says in German:
"Laufzeitfehler '4605'
Diese Methode oder Eigenschaft ist nicht verfügbar, weil das Dokument
für Bearbeitung gesperrt ist."

In English this should mean
"Runtimeerror '4605'
This method or feature is not available, because the document's
editing is blocked."

How can I solve this problem?

Thank you for answers in advance,
Andreas

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Change Font Size in Incoming E-mail? T-rex915 Microsoft Outlook Discussion 1 12th May 2010 08:21 PM
change the size of Font for reading incoming mail Carl Microsoft Outlook 4 6th Nov 2008 06:14 PM
How do I change the font size on incoming email outlook 07 Clink Microsoft Outlook Discussion 1 22nd Aug 2008 11:34 PM
how to change font size on incoming and inbox =?Utf-8?B?TXJQYXVsNzIy?= Microsoft Outlook Discussion 2 12th Nov 2004 12:46 AM
Change the font size of incoming / received emails Andy Microsoft Outlook Discussion 1 16th Oct 2003 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:34 PM.