Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening Documents & Files thru Office Automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Opening Documents & Files thru Office Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01392754
Message ID:
01392754
Views:
96
I am trying to open Office & non-Office documents from a command button from the fullpath, using the given file extension.
Word & Excel work OK. However I cannot the appropriate members of the Visio Object Model.

I have found all the Object Model for Offive XP at : http://msdn.microsoft.com/en-us/library/aa155792(office.10).aspx

Is there another way of opening files and viewing them, such as text files?

the Method I am using is shown below
WITH Thisform
	lcSelected = ALLTRIM(.txtGetFile.Value)
	lcFileExt  = LOWER(SUBSTR(lcSelected,AT(".",lcSelected)+1,LEN(lcSelected)-AT(".",lcSelected)))
	DO CASE 
	CASE lcFileExt = "doc"
		loX = CREATEOBJECT("Word.Application")
		loDoc = loX.Documents.Open(lcSelected)
		loX.Visible = .T.
	CASE lcFileExt = "xls"
		loX = CREATEOBJECT("Excel.Application")
		loDoc = loX.Workbooks.Open(lcSelected)
		loX.Visible = .T.
	CASE lcFileExt = "vsd"
		loX = CREATEOBJECT("Visio.Application")
		loDoc = loX.Open(lcSelected)
		loX.Visible = .T.
	CASE lcFileExt = "txt"
	ENDCASE 

	.Refresh 
ENDWITH 
Regards

Tony Millard
Next
Reply
Map
View

Click here to load this message in the networking platform