Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preview a contents of word file in a pop up window

Status
Not open for further replies.

madvinny

Technical User
Oct 23, 2001
3
GB
I have created a menu in which different files can be selected. i.e. Select 'countries' from the menu. Select 'UK' from the countries menu, preview file called 'South.doc' from a number of files listed on the 'UK' menu. If this file isnt the one wanted I would like to be able to go back to the same menu position and preview the next file. i.e. 'Countries','UK','North.doc'. Any help would be appreciated.
 
Try this function, it is a Start.

Function GetTextOnlyExample(intParagraphNumber As Integer) As Variant
' This procedure illustrates how to return all the text, but not the
' paragraph mark, contained in a paragraph of the active document.
' To easily see the difference between a range that includes the
' paragraph mark and one that does not, un-comment the commented code
' in the With...End With statement in this procedure. When the code
' hits a Stop statement, view your document, and compare how the selections
' differ.
Dim rngParaText As Range
Dim strTemp As String

' Make sure that intParagraphNumber is <= to the number of paragraphs
' in the document.
If intParagraphNumber > ActiveDocument.Paragraphs.Count Then
GetTextOnlyExample = Null
Exit Function
End If

Set rngParaText = ActiveDocument.Paragraphs(intParagraphNumber).Range
With rngParaText
.SetRange rngParaText.Start, rngParaText.Start + rngParaText.Characters.Count - 1
GetTextOnlyExample = .Text
End With
End Function Best Regards

---
JoaoTL
mail@jtl.co.pt
My MS Access Site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top