Technical Notes, Zetafax

FIX: RTF formatted emails have margins added to sent fax when using the email gateway

ZTN1309

ID: ZTN1309

This Zetafax technical note applies to:

  • Zetafax version 7.5 or later

Symptom

When you have an email submitted to Zetafax via the email gateway either using Lotus Notes/Domino or Microsoft Exchange in Rich Text Format (RTF) the sent fax will have margins added which did not exists in the original email message.

Example:

This is the original message created in Lotus Notes.

And this is the resultant fax that Zetafax sends which has margins added.

Cause

This problem occurs because the body of the message is in RTF format but doesn't have any margin information for word to use when converting into a fax image file. Further erroneous behaviour can occur as Word will use the default settings for an RTF document for the LETTER page format.

Resolution

To resolve this problem the Normal.dot file needs to be edited so that it includes a macro which modifies the page size and margins when the email gateway opens Word to render RTF files.

To do this, work through the following steps:

  1. On the Zetafax server, log in as the user which the Zetafax server service or application normally runs as.
  2. Open Microsoft Word and close any open documents.
  3. Click on the " Tools" /" Macro" /" Visual Basic Editor" menu.
  4. In the left-hand window click on the " Normal" project, " Microsoft Word Objects" folder then on " ThisDocument" .
  5. Right-click " ThisDocument" and select " View Code" .
  6. Copy and paste the following text into the "Normal - ThisDocument (Code)" window.

Private Sub Document_Open()

      ' Modify only RTF documents

      If InStr(UCase(ActiveDocument.Name), UCase(" .rtf" )) Then

              With ActiveDocument.PageSetup

                              ' Set top margin to 1 cm

                              .TopMargin = CentimetersToPoints(1)

                              '.BottomMargin = CentimetersToPoints(0)

                              '.LeftMargin = CentimetersToPoints(0)

                              '.RightMargin = CentimetersToPoints(0)

                              ' Set header size to 0 cm

                              .HeaderDistance = CentimetersToPoints(0)

                              '.FooterDistance = CentimetersToPoints(0)

                              ' Set page size to A4

                              .PageWidth = CentimetersToPoints(21)

                              .PageHeight = CentimetersToPoints(29.7)

                      End With

      End If

End Sub

  1. Save and close all open Word windows.
  2. Resubmit a fax to verify that the problem is resolved.

Note: The macro will affect all RTF documents opened by the configured user on the Zetafax server.

The page size and margins can be configured at any time by following steps 1-5 above and then changing the Margins, Header/Footer and Page size settings, followed by step 7. The units are in centimetres. The default for the top margin is 1 cm, and the page size is set to A4. Note that lines starting with a single quote are presently commented out. To activate, remove the single quote from the start of the line.

Last updated: 7th August 2003 (SV/DH)