|
|
|||||||
Hi, I have a Kixform running which maps a network drive and I want it to open up a word document, the form works, the drive maps, however the doc won't open, I think there is something not right with the run "g:\test.doc", can anyone help? Cheers Break On $System = CreateObject("Kixtart.System") ;create form $Form = $System.Form() $Form.BackColor = 212,208,200 $Form.FontSize = 8,25 $Form.Height = 187 $Form.Left = 200 $Form.Text = "Documentation Tool" $Form.Top = 110 $Form.Width = 275 ;create pulldown menu $ComboBox = $Form.Controls.ComboBox() $ComboBox.DropDownWidth = 121 $ComboBox.FontSize = 8,25 $ComboBox.Height = 21 $ComboBox.Left = 50 $ComboBox.Sorted = "False" $ComboBox.Text = "Select Document" $ComboBox.Top = 60 $ComboBox.Width = 148 $ComboBox.AddItem ("EPC - With Kerridge DMS") ;create button $Button = $Form.Controls.Button() $Button.FontSize = 8,25 $Button.Height = 30 $Button.Left = 50 $Button.Text = "Map Document Drive G:" $Button.Top = 20 $Button.Width = 110 $Button.OnClick = "Button_Map()" ;create button $Button = $Form.Controls.Button() $Button.FontSize = 8,25 $Button.Height = 28 $Button.Left = 50 $Button.Text = "Open Document" $Button.Top = 100 $Button.Width = 110 $Button.OnClick = "Button_Open()" $Form.Show While $Form.Visible $=Execute($Form.DoEvents()) Loop Exit 1 Function Button_Click() $app = $comboBox.text Select Case $app = "Select Document" $rc = MessageBox("No Doc Selected.","Error",16,0) EndSelect Endfunction Function Button_Open() $app = $comboBox.text Select Case $app = "EPC - With Kerridge DMS" Run "g:\test.doc" EndSelect Endfunction $Form.Show While $Form.Visible $=Execute($Form.DoEvents()) Loop Exit 1 ; Function Button_Map() Use g: '\\szgb06\company\Dealers\Documents' EndFunction |
||||||||
|
|
|||||||
yes, doc is not registered extension, thus it can't be ran. hmm... try: run 'explorer "g:\test.doc"' |
||||||||
|
|
|||||||
Excellent help, many thanks, it works ! |
||||||||
|
|
|||||||
More safe solution just in case .doc is not associated to winword.exe and more then one word version is used. Code:
|
||||||||
|
|
|||||||
actually, does not make that much safer. word checks the versioning and file assocs every time it runs, no? but yes, this is nicer way of doing it. |
||||||||
|
|
|||||||
You're right the version of word has nothing to do with it in this case. I’ve been working on a script to determine the installed office version. Stuff was still spinning around in my head I guess. |
||||||||
|
|
|||||||
stuff don't spin in my head that much but in my stomach instead :P |
||||||||
|
|
|||||||
LOL |