Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert File - Plain text (Word97SR2)

    Chris.

    Open the file, read the text into a string variable, and Paste Special as unformatted text.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert File - Plain text (Word97SR2)

    > Open the file, read the text into a string variable

    Oh good! Now I have thirty-seven ways of doing it (grin!).

    I elected to save the range and the immediate style (usually Normal), insert File, contract the range.end by two positions, then re-apply the immediate style to the range of inserted text.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insert File - Plain text (Word97SR2)

    The accompanying macro works fine, and I can modify it, but ....

    It seems that InsertFile, when obtaining data from an ASCII text file, chooses the paragraph style "Plain Text". I can see no straightforward means of causing InsertFile to use "Normal" style - or to set any user-default in place of Plain text.

    Am I missing something here?

    <pre>Public Sub udf_AddressFromFile()
    Dim strFile As String
    strFile = "d:greavespcfENV.TXT"
    If boolFileExists(strFile) Then
    Selection.InsertFile FileName:=strFile, Range:="", ConfirmConversions:=False, _
    Link:=False, Attachment:=False
    Selection.MoveUp Unit:=wdParagraph, Count:=1
    Call cmd_GlueReturns
    Else
    End If
    End Sub
    </pre>


Posting Permissions

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