Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


open a text file with Word


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2007, 05:37 PM
Junior Member
 
Join Date: Apr 2007
Posts: 42
Send a message via Yahoo to mwaite
Default open a text file with Word

I'd like to open a text file for viewing by launching it's associated filetype application. Windows registry default for txt files is Pocket Word, however I can't figure out how to open a txt file to pword.exe via B4P.

These two commands will open a pwd file:
Shell(pword.exe, "-opendoc \temp\readme.pwd")
Shell(pword.exe, "\temp\readme.pwd")

However using a txt extension instead fails. Word opens, but errors with "A problem with the document was encountered and it cannot be opened". I can double-click the same txt file in Explorer and it opens properly in Word.

I suspect there's another attribute for opening non-native formats?

Searching the Web has failed me.
__________________
Regards,
Mike

PPC Cingular 8525 WM5 4Gb SD
Reply With Quote
  #2 (permalink)  
Old 06-14-2007, 05:59 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

Hmm... on my WM5 device there is no problem opening .txt files with PocketWord through the shell command.
I testet small and big, ascii and unicode files but everything worked fine.

specci48
Reply With Quote
  #3 (permalink)  
Old 06-15-2007, 12:47 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default

I believe You should only shell the file(.txt,.doc, etc) itself as the known associated app will automatically be started...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #4 (permalink)  
Old 06-15-2007, 11:09 PM
Junior Member
 
Join Date: Apr 2007
Posts: 42
Send a message via Yahoo to mwaite
Default still treading water, and sinking fast

Cableguy - I seem to be able to shell the file itself only on the PC. On the PDA it does nothing, no error, no anything. I even confirmed that shell command is being exectued shell("myfile.txt","") and shell("myfile.txt") does nothing.

specci48 - can you please confirm or provide the shell command you used? I don't understand what could be different if you can open these file types and I cannot. Looks like I have the standard txt file extension type leading to pword.exe in the registry, but I can't open it.

Thanks guys!
__________________
Regards,
Mike

PPC Cingular 8525 WM5 4Gb SD
Reply With Quote
  #5 (permalink)  
Old 06-15-2007, 11:26 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default

If you can open a .doc file by tapping it, ten shelling should work, I would suggest you to use a regestry editor and browse the extension association keys to see if they are correct...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #6 (permalink)  
Old 06-16-2007, 12:01 AM
Junior Member
 
Join Date: Apr 2007
Posts: 42
Send a message via Yahoo to mwaite
Default

Cableguy,

I have done that from the beginning. I suspect if there was a problem with registry association then perhaps I should be able to shell to some other file type, but so far trying to open files like pdf, ppt, doc, txt, htm, jpg, mp3 directly via Shell all fail, yet I can click on them in Explorer and their respective application launches and opens the file.

Using the .txt file type as an example, I have the following in the registry:

HKEY_CLASSES_ROOT\.txt >> default = txtfile
so then if I go to txtfile:
HKEY_CLASSES_ROOT\txtfile\Shell\Open\Command >> default = pword.exe %1
and also
HHKEY_CLASSES_ROOT\txtfile\Shell\OpenDoc\Command >> default = pword.exe -opendoc %1

Could you please verify you have these values?

And you are able to launch, say a text file call test.txt in \temp folder:
Shell("\temp\test.txt") or Shell("\temp\test".txt,"") (figure one of these would work)
and this will open pword with the contents of test.txt?

If so man I'm stumped. Wonder if Resco Explorer could have anything to do with it? It's a pretty powerful Explorer replacement and, lack of any other suspect, wonder if it could be doing some reassigning?

Appreciate the continued assistance!!
__________________
Regards,
Mike

PPC Cingular 8525 WM5 4Gb SD
Reply With Quote
  #7 (permalink)  
Old 06-16-2007, 10:03 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 636
Default

Hi mwaite,

the code I used is
Code:
Shell("pword.exe","\temp\test.txt\")
which is not diffeent from yours.

I checked my registry and found additional entries like

HKEY_CLASSES_ROOT\.txt >> Content Type = text/plain
HKEY_CLASSES_ROOT\txtfile\ >> Default = txt
HKEY_CLASSES_ROOT\txtfile\ >> EditFlags = 65535


specci48
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload text file aerohost Questions & Help Needed 2 06-17-2008 06:37 PM
Button Control text label word wrap TWELVE Basic4ppc Wishlist 0 06-04-2008 06:55 AM
file open question scott93727 Questions & Help Needed 4 05-30-2008 10:07 AM
Automatically Open Pword With A Word File sintaq Questions & Help Needed 3 03-26-2008 03:31 PM
How to achieve text edtion like in word? Cableguy Questions & Help Needed 3 07-03-2007 04:52 PM


All times are GMT. The time now is 02:23 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0