Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Sep 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Envelope Text (VB 2005/Word 2003)

    I having trouble with my latest GoldMine add-on that prints envelopes by interfacing with Word 2003. Tthe charcters TN Dept. of Labor and Workforce Dev. in an address wraps on the printed envelopes. To fix this I would like to change the font face and size of the address and return address or make the text box bigger without changing the defaults in normal.dot. Is this possible?

    In my PrintTNEnvelope sub after the code that populates the strAddress and strReturnAddress variables I have

    With objWordApp
    'hide word
    .Visible = False 'For Some Reason it Still Displays

    'set envelope addresses and print options
    .Documents.Add.Envelope.Insert(Address:=strAddress , ReturnAddress:=strReturnAddress)

    'hide active window
    .ActiveWindow.Visible = False

    'set printer options and print envelope
    With objWordApp
    .ActivePrinter = dlgPrinter.PrinterSettings.PrinterName
    .ActiveDocument.Envelope.DefaultPrintBarCode = True
    .ActiveDocument.Envelope.DefaultPrintFIMA = False
    .ActiveDocument.Envelope.FeedSource = Microsoft.Office.Interop.Word.WdPaperTray.wdPrinte rEnvelopeFeed
    .ActiveDocument.Envelope.PrintOut()
    End With

    'close document
    .ActiveDocument.Saved = True
    .Documents.Close()
    End With

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Envelope Text (VB 2005/Word 2003)

    Hi, can you post a sample of the envelope? Temporarily add Exit Sub before the last three lines so you can save the document. Change any confidential information to something generic. Thanks.

  3. #3
    New Lounger
    Join Date
    Sep 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Text (VB 2005/Word 2003)

    Please find a sample attached.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Envelope Text (VB 2005/Word 2003)

    Try adding this after your Envelope.Insert line. I'm not sure the envelope exists at that point. If it doesn't, you might need to insert it later in the process.

    <code>' For centered frame, widen by 2 inches and move left indent
    ' 1 inch to the right to maintain its relative position
    Dim p As Word.Paragraph
    With .ActiveDocument.Content.Frames(1)
    .Width = .Width + InchesToPoints(2)
    For Each p In .Range.Paragraphs
    p.LeftIndent = p.LeftIndent + InchesToPoints(1)
    Next
    End With</code>

  5. #5
    New Lounger
    Join Date
    Sep 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Envelope Text (VB 2005/Word 2003)

    That code did work no matter where I placed. After a lot of fiddling I realized that the wrapping will not occur if I have the default font face for the Address and Return Address styles in my normal.dot set to Verdana instead of Comic Sans MS. So for now I have decised to leave the program code as originally posted and have the new normal.dot settings even though originally I wanted normal.dot to stay the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •