Can an .RTF file be used without MSOffice (Access related)

Mike375

Registered User.
Local time
Today, 15:29
Joined
Aug 28, 2008
Messages
2,548
I could test some of this myself by uninstalling MSOffice but perhaps I can avoid that paid:D

In code I use to print Word docs that have had data inserted to bookmarks is

WordDoc.SaveAs ("c:\Letters\MyLetter " & ([Forms]![PrintAndClose]![CLSurname]) + " " & Format(Now, "YYYY-MM-DD") + " " & Format(Now, "hh-mm-ss") + ".doc")

No problem if I change ".doc' to ".rtf" and ".txt".

However, if I open the doc in Worpad that has be saved as .txt there is "junk" all above and below the body of the letter. The RTF is fine and will also show the bookmarks, when they are turned on for viewing in Word.

I also noticed that Wordppad by default saves as RTF.

I have two questions.

1) If I email someone an document in .rtf can they open it if they don't have MSOffice

2) Possibly answered from question 1.....If the runtime version of Access is used and working with Word Bookmarks is a major point, can anything be done if the person does not have MSOffice. As far as I can tell Wordpad does not offer bookmarks although it shows them when opening an RTF file.
 
From here it would appear that RTF is a universal format able to be opened by most WP packages

The Rich Text Format (often abbreviated RTF) is a document file format developed by Microsoft in 1987 for cross-platform document interchange. Most word processors are able to read and write RTF documents.
 
Thanks for that John.

That sounds like if there is only one computer with MSOffice then that could be use to produce the docs and in my copy procedure I could have them saved as RTF and across the network to the other computers.

I notice than when a Wordpad document is saved as RTF the file as the Word icon. I assume that icon would go if MSOffice was removed.

Would Wordpad have the option to save as RTF is MSOffice is not installed. I get the feeling I am going to be uninstalling and reinstalling on the weekend:D
 
You could also use SnapShot format, there is a free viewer that can be downloaded from here. You wont loose any of you nice formating that way.
 
I assume that is the same as when you email a Report in Snapshot format. but the user does not need Access on their computer to open it.
 
RTF is indeed platform-independant. It also doesn't support macros, which is a security bonus when emailing files! Any word processing software should be able to read RTF documents, including OpenOffice, WordPad, Lotus, etc.

The icon associated with RTF documents will differ from machine to machine, depending on what program is associated with RTF files to open them by default when the file is double-clicked.

The other option is to produce PDF files, using a programme like Win2PDF. The licensing cost for this software is minimal and it can allegedly be controlled using VBA, so could be coded inside your MS Access application.

I say allegedly because, although I have bought and frequently use the software, I haven't tried the coding side. As a PDF producer though, it's worth its weight in gold!

Alan
 
I just tried an experiment:) I save one of my Word docs as RTF and then gave it the same name as the original Word.doc.

I made one change to the code and that was just changing doc to rtf as in


Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Open _
("C:\Letters\0Letter1Mike.rtf")
WordObj.Visible = True

All worked perfectly. Bookmarks were filled, printed out, was saved as date/time stamped file, was copied and pasted back to new record in a Many table/memo field and the document was closed without saving.

However, when 0Letter1Mike.rtf is opened from the folder (double click) the button at the bottom of the screen has 0Letter1Mike Microsoft Word.

Would what I did have worked if I had the runtime version of Access and the computer did nopt have MSOffice installed.
 
It only says Microsoft Word because Microsoft Word is installed and Microsoft Word is the application associated with opening RTF files.

If you went into My Computer and clicked on Tools > Folder Options, you'd get a dialog box. Choose the File Types tab at the top to display a list of registed file types.

Scroll down the list to find RTF and click the change button to show a list of programs which can be associated with this type of file. Choose Wordpad and click [OK], the [Close] on the dialog box.

Lo, and the icon has changed! RTF files will now open in Wordpad rather than Microsoft Word. This principal holds for all computers; the file icon (unless specifically set) will be that of the program associated to open this file type by default.
 
Great, thanks for that.

In some ways it is a shame that Access does not have some sort of built in Word system. But then if it was easy I could not charge any money to make Word a new experience for people:D

For what I do and apart from the normal Word deal, I find the Word doc with linked queries that have been formatted to look as if the numbers were typed in to be a much better thing than Reports. A lot more fiddling and a lot more potential bugs but the finished product is better.
 
Mike, what you are doing doesn't really have anything to do with Access. You are using VBA to automate Word to produce the documents. You could just as well have used Visio or PowerPoint, both of which support VBA. As to the format of .rtf files, they are plain text which is why they are platform independent. If you open an .rtf file with NotePad, you will see all the embedded formatting code as well as the document text. If you search the Microsoft site, you can find the format definition that the .rtf file uses. It explains all the codes that are used to turn on various formatting options such as font and color, etc. This is a very old concept and goes way back to mark up languages such as Script which were used on the mainframe in the 70's and possibly earlier.
 
Mike, what you are doing doesn't really have anything to do with Access. You are using VBA to automate Word to produce the documents. You could just as well have used Visio or PowerPoint, both of which support VBA.

Pat, yes I have seen that and sometimes I get a solution from a website that has been about Excel. In fact just a couple of days ago I got the following off a thread on Excel.

Call Shell("explorer.exe c:\Letters", vbNormalFocus)

except the Call part was not there.

I have very little to do with Word except of course using it to take Access data but I have noticed that a Word macro appears to be a container for VBA and quite the opposite to an Access macro. Although I suspect an Access macro is like a pre packaged VBA as when you spell a field name incorrectly of do a SetValue that can't be done etc. the pop up box refers to Visual Basic object etc.
 

Users who are viewing this thread

Back
Top Bottom