Results 1 to 20 of 31

Thread: Solved: Extra Unwanted Page at End of Document

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #27
    Knowledge Base Approver
    Space Cadet
    VBAX Tutor sandam's Avatar
    Joined
    Jan 2005
    Location
    London
    Posts
    292
    Location
    Yup - it was so frustrating for a while but then after a little F1 searching I found VBA has two very useful functions for string and characters Chr and Asc. I used Asc(selection.text) on a blank cell and lo and behold the returned value was 13. I have a couple of nifty procedures to manipulate strings aren't provided by VBA (or are but not to do what I want) and I'm trying to tie them up into a Kb entry (after I get back from vacation ). Another useful tip is looking at the ascii tables provided in VBA. Especially for numbers 0-127 - i use these to search through strings when StrComp etc. just won't do.

    And for the end of cell marker space question - try this (I know its not totally effecient but it should work.

    [vba]
    Dim countChars as integer
    Dim temp as string
    Dim fRange as Range
    ActiveDocument.Tables.Item(x).Cell(I,J).Select 'x = number of table in document
    fRange = Selection.Range
    temp = ""
    For countChars = 1 to fRange.Characters.Count
    If countChars = fRange.Characters.Count
    temp = temp + " " + Asc(fRange.Characters.Count)
    Else
    temp = temp + Asc(fRange.Characters.Count)
    End if
    Next countChars
    [/vba]
    Last edited by sandam; 03-04-2005 at 07:32 AM. Reason: forgot a comment
    Nothing annoys a non-conformist more than other non-conformists who refuse to conform to the rules of non-conformity.


    Confused is my normal state of mind


Posting Permissions

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