OK
I'm trying to create some code that will enable a user to open a new bmp file (with automatically generated file name) to enable a sketch to made and captured.
The code I've generated works perfectly on a PC, with a new file with automatically generated filename created, which is then opened by bmp editing software and can then be saved. The code for editing a specific bmp file also works on a PC with the selected file being opened.
HOWEVER, on a PDA running windows mobile 6 the same code fails to open the specified filename, neither the newly created file nor an existing file for editing. Instead the Paint software opens with the last image/sketch still displayed, and to save I have to manually enter the system generated filename. To edit a pre-existing file I have to browse for the relevant file.
Is there any coding amendments that can get around this OS specific issue?
Here's an extract of the code that works perfectly on a PC, some unnecessary code has been removed for this post. Apologies for my clumsy coding I'm self taught 😮
**************************************
sub AddSketch
dim F1, F2, curStat, RSketch, statID, text, filename, incre_Numb, SketchPath, fSketchFile
dim DirPath, PathLength, exPath, SysID
' create unique sketch filename
set F1 = Application.Map.Layers("fieldata").Forms("EditForm").Pages("Stationinfopage") ' form containing locality information
Set F2 = Application.Map.Layers("fieldata").Forms("FORM30").Pages("PAGE1") ' form controlling sketch function
DirPath = Application.UserProperties("FD_filepath") 'file directory path
curStat = F1.controls("cboregion") & F1.controls("cboyear") & "-" & F1.controls("editStat") ' generates a location identifier
incre_Numb = SketchRecordID() ' function returns an incrementing number for bmp files at present locality
filename = curStat & "(" & incre_Numb & ").bmp" ' generates the .bmp filename
' create .bmp file with unique name then open it
Set fSketchFile = CreateAppObject("File")
SketchPath = DirPath & "sketches\" & filename 'directory path to .bmp file
fSketchFile.Open SketchPath, 2 'Open and write to the end, open with default
fSketchFile.Close
Application.Run(SketchPath) 'opens .bmp file with default application ****THIS DOES NOT OPEN THE SPECIFIED FILE ON A WINDOWS MOBILE PLATFORM*****
InitiateSketch ' sub that initiates a form to show a list of sketch filenames at present locality
end sub
Any ideas how I can get the code to open a specific file when run on Windows mobile system would be much appreciated.
Mike