Re: Size limit on exporting strings from Outlook forms to Excel

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 02/25/04


Date: Wed, 25 Feb 2004 14:45:15 -0500

What version of Excel? Versions from 2000 on should be able to handle up to
32k characters in a cell.

-- 
Sue Mosher, Outlook MVP
Author of
     Microsoft Outlook Programming - Jumpstart for
     Administrators, Power Users, and Developers
     http://www.outlookcode.com/jumpstart.aspx
"Jason Stroup" <j.stroup@sportsmedia.com> wrote in message
news:63fe0f15.0402250841.6ad22621@posting.google.com...
> I am trying to print an Outlook Form from the form itself using a
> print button.  The form is a vacation day approved form, and the code
> behind the button looks like the code below.  It works fine as long as
> the text strings are short, but the last three strings - conflicts,
> resolutions and comments can be longer than 255 characters.  When this
> happens, it prints out #VALUE! instead of the text.  ANy ideas on how
> to fix this?
>
> Thanks
>
> Function cmdPrint_Click()
> Set oExcelApp = CreateObject("excel.application")
> If oExcelApp Is Nothing Then
> MsgBox "Couldn't start Excel."
> Else
> Dim oExcelApp
> Dim oExcelDoc
> Dim ApplicationName
>
> ' Open a new document
> Set oDoc = oExcelApp.Workbooks.Open("\\Dc2-srv\SportsMEDIA
> Shares\SMTShare\Adm\Holidays & Vacations\Vacation Sick Print
> Form.xls")
>
> If Item.UserProperties("RequestType") = "VACATION" Then
> oDoc.worksheets("Vacation Day(s) Request Form").range("F5").Value =
> " - Request for Vacation Days"
> Else
> oDoc.worksheets("Vacation Day(s) Request Form").range("F5").Value =
> " - Request for Sick/Personal Days"
> End If
>
> oDoc.worksheets("Vacation Day(s) Request Form").range("D7").Value =
> Item.UserProperties("Employee")
> oDoc.worksheets("Vacation Day(s) Request Form").range("D9").Value =
> Item.UserProperties("Supervisor")
> oDoc.worksheets("Vacation Day(s) Request Form").range("D11").Value =
> Item.UserProperties("Director")
>
> oDoc.worksheets("Vacation Day(s) Request Form").range("L7").Value =
> Item.UserProperties("StartDate")
> oDoc.worksheets("Vacation Day(s) Request Form").range("L9").Value =
> Item.UserProperties("EndDate")
> oDoc.worksheets("Vacation Day(s) Request Form").range("L11").Value =
> Item.UserProperties("DaysRequested")
>
> oDoc.worksheets("Vacation Day(s) Request Form").range("E16").Value =
> Item.UserProperties("TotalDays")
> oDoc.worksheets("Vacation Day(s) Request Form").range("E18").Value =
> Item.UserProperties("DaysTaken")
> oDoc.worksheets("Vacation Day(s) Request Form").range("E20").Value =
> Item.UserProperties("DaysRemaining")
>
> oDoc.worksheets("Vacation Day(s) Request Form").range("L16").Value =
> Item.UserProperties("TotalDays")
> oDoc.worksheets("Vacation Day(s) Request Form").range("L18").Value =
> Item.UserProperties("AfterDaysTaken")
> oDoc.worksheets("Vacation Day(s) Request Form").range("L20").Value =
> Item.UserProperties("AfterDaysRemaining")
>
> oDoc.worksheets("Vacation Day(s) Request Form").range("D25").Value
> Item.UserProperties("Conflicts")
> oDoc.worksheets("Vacation Day(s) Request Form").range("D31").Value
> Item.UserProperties("Resolutions")
> oDoc.worksheets("Vacation Day(s) Request Form").range("D37").Value
> Item.UserProperties("Comment")
>
> ' Print the Excel document
> oDoc.PrintOut
> ' Close and don't save changes to the document
> Const wdDoNotSaveChanges = 0
> oDoc.Close wdDoNotSaveChanges
>
> ' Close the Excel instance
> oExcelApp.Quit
>
> ' Clean up
> Set oDoc = Nothing
> Set oExcelApp = Nothing
> End If
> End Function


Relevant Pages

  • Re: Outlook/Excel
    ... your request, such as ... Do you want the code to run on demand, ... Do you want the code to run from Outlook, or from Excel? ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Excel Export into Outlook contacts
    ... Did you ever receive an answer to your request? ... I have an excel 97 file that I need to import into Outlook ... Google and Other Search Engines (Visual ...
    (microsoft.public.outlook.contacts)
  • Installing/uninstalling Office XP Pro - HELP!!!
    ... Setup path: D:\WWW\Microsoft Office XP PRO (word, excel, powerpoint, ... D:\WWW\Microsoft Office XP PRO (word, excel, powerpoint, outlook, ...
    (microsoft.public.windowsxp.basics)
  • Re: Installing/uninstalling Office XP Pro - HELP!!!
    ... | outlook, access, frontpage)\SETUP.EXE ...
    (microsoft.public.windowsxp.perform_maintain)
  • Installing/uninstalling Office XP Pro - HELP!!!
    ... Setup path: D:\WWW\Microsoft Office XP PRO (word, excel, powerpoint, ... D:\WWW\Microsoft Office XP PRO (word, excel, powerpoint, outlook, ...
    (microsoft.public.windowsxp.perform_maintain)