Jump to content

randlem

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About randlem

  • Rank
    member
  1. Hi, I did set/declare 'objFM': Set objFM = WScript.CreateObject ('FMPRO.Application')¶ Set objFMfiles = objFM.Documents¶ for each objTargetFile in objFMfiles¶ if objTargetFile.fullname = 'D&H Sales Database - Development.fmp12' then¶ objTargetFile.DoFMScript ('OpenAcknowledgementScript')¶ end if¶ next¶ Set objFMfiles = nothing¶ Set objFM = nothing¶ Set objTargetFile = nothing¶" But the script did not fire. Regards, Mark.
  2. Hi Wim, I found some code on a google search that I had not spotted which works: Set FMApp = CreateObject('FMPRO.Application')¶ Set FMDocs = FMApp.Documents¶ FMApp.Visible = True¶ Set FMActiveDoc = FMDocs.Active¶ FMActiveDoc.DoFMScript ('OpenAcknowledgementScript')¶ Set FMDocs = Nothing¶ Set FMActiveDoc = Nothing¶" Many thanks for all you help. Kind regards,
  3. Hi Wim, Thanks for that. I tried the following code: Set objFMfiles = objFM.Documents¶ for each objTargetFile in objFMfiles¶ if objTargetFile.fullname = 'D&H Sales Database - Development.fmp12' then¶ objTargetFile.DoFMScript ('OpenAcknowledgementScript')¶ end if¶ next¶ Set objFMfiles = nothing¶ Set objFM = nothing¶ Set objTargetFile = nothing¶" I got a WSH error - Object Required 'objFM' Then I tried (with & without the .fmp12): Set objFM = WScript.CreateObject ('FMPRO.Application')¶ Set objFMfiles = objFM.Documents¶ for each objTargetFile in objFMfiles¶ if objTarget
  4. Hi Wim, Thanks for your response. Not too sure what you mean by "just loop through the FM documents collection until you have the right one targeted and then run the script" So is the code below what I should be looking at?. Set objFM = WScript.CreateObject ('FMPRO.Application')¶ If objFM.ScriptStatus = 0 then¶ Set objFMfiles = objFM.Documents.DoFMScript ('OpenQuotationScript')¶ objFM.Visible = True¶ End If¶
  5. Afternoon Guys, I could do with some help with following code: Set objFM = WScript.CreateObject ('FMPRO.Application')¶ If objFM.ScriptStatus = 0 then¶ Set objFMfiles = objFM.Documents.Open(‘Database.fmp12','un','pw')¶ objFM.Visible = True¶ objFMfiles.DoFMScript ('OpenQuotationScript')¶ End If¶ This code basically opens a word doc after it has had it's bookmarks populated and closed. The code works fine until a different user other than the one I used in the 'un' & 'pw' is logged in and then I get a WSH error. So is there a way of using the Set objFMfiles = objFM.Do
  6. Guys, I managed to sort it: Set objFM = WScript.CreateObject ('FMPRO.Application')¶ If objFM.ScriptStatus = 0 then¶ Set objFMfiles = objFM.Documents.Open(‘Database.fmp12','un','pw')¶ objFM.Visible = True¶ objFMfiles.DoFMScript ('OpenQuotationScript')¶ End If¶" Although it is very slow in eventually opening about 30s, not sure if that is because I testing over a vpn. Regards, Mark.
  7. Hi Wim, Could I trouble you for some assistance please ActiveX, Adding to my VBScript to run a Filemaker Script Please see my script below: #Define Sales Person's Full Name #Define VBScript filename relative to current user's Documents folder (e.g. typically filewin:/C:/Users/User/Documents/Generate_Word. VBS) Set Variable [ $VBSFilePath; Value:"filewin:" & Get(DocumentsPath) & "Generate_Word.VBS" ] #Define Output Word filespec relative to current user's Documents folder (e.g. typically filewin:/C:/Users/User/Documents/Word Sample.doc) Set Variable [ $WordFileP
  8. Is this what you are looking for: If [ Quotes::Doc Num>0 ] Show Custom Dialog [ Title: "Warning!"; Message: "Quote Document already created."; Default Button: “OK”, Commit: “Yes” ] Else If [ Quotes::Sales Person ="JQ" ] Set Variable [ $SP; Value:"Jeremy Quantrill" ] Set Variable [ $Position ; Value:"Director" ] Else If [ Quotes::Sales Person = "BS" ] Set Variable [ $SP; Value:"Brian Spiking" ] Set Variable [ $Position ; Value:"Director" ] Else If [ Quotes::Sales Person = "MH" ] Set Variable [ $SP; Value:"Mark Harper" ] Set Variable [ $Position ; Value:"Director" ] Else If
  9. Here Goes: "Set objWord = CreateObject('Word.Application')¶ objWord.Application.Visible = True¶ Set objDoc = objWord.Documents.Open( '///192.168.21.1/CompanyDernier & Hamlyn Sales DocumentationTemplatesquotation template.doc',,True)¶ Set objRange = objDoc.Bookmarks('QuoteDate').Range¶ objRange.Text = '" & Quotes::FormatDate & "'¶ Set objRange = objDoc.Bookmarks('QuoteRef').Range¶ objRange.Text = '" & $QuoteRef &"' ¶ Set objRange = objDoc.Bookmarks('QuotePhone').Range¶ objRange.Text = '" &" " & Quotes::QuotelPhone & "'¶ Set objRange = objDoc.Bookmarks('QuoteC
  10. Hi John, Thanks John for your response. No difference, just sits in the Taskbar and flashes when the bookmarks are populated and the document is being saved with a different name. I am wondering if there is a possibility that the problem could be the combination of Win 8.1 & Word 2010. Regards, Mark.
  11. Hi Singo, Sorry for the delay in getting back to you. I hadn't checked the forum as I was quite happy with the solution. When the script is being run over the vpn I have to change the pause to 25s. So any code the you can suggest to open the Word Doc in the foreground without having to close and re-open would be greatly appreciated. Kind regards, Mark.
  12. I have found what my problem was: I was using RightValues( Self ; 1 ) to input the radio set button value which causes a carriage return to be added to the end of the value. I found out that by using GetValue( Self ; ValueCount( Self ) ) stops the carriage return being added to the end of the value. I have tested and it works with my original calculation. Regards, Mark.
  13. Many thanks for your response. I changed the calculation to use IF PatternCount >0 then 1 else 0, which works. Regards, Mark.
  14. Hi There, I need some help with performing a calculation on a field in a table based on the contents of another field in the same table. The field I want base my calculation on is call Status whose content comes from a radio button set in a layout. The radio button set has three options Outstanding, Won and Lost. So I created a field called Outstanding set Type to Calculation and inserted the calculation: Case(Status = "Outstanding";1;0). When I display the field in a report all the rows show the value as 0 when at least 50% of the should display 1 and the Status field display
  15. Many thanks Rgordon. Worked a treat. Regards, Mark.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.