change font size of incoming emails

  • Thread starter Thread starter Andreas
  • Start date Start date
A

Andreas

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
 
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.
 
Hello Ken,

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
 
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
 
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.




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
 
Back
Top