Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

opening a word document

Featured Replies

  • Newbies

I'm looking for a script to automatically open a word document.

Every record needs to open a different word document, but the documents are all in the same place.

Any suggestion ?

Hi,

The script below is based on the assumption that your documents are stored in the same folder as your filemaker file. It's overkill as I realized afterwards that this is more likely to NOT be the case.

It might help someone one day though crazy.gif

Based on it, You should easily find your way assuming (again) that each document name is stored in a field called 'DocumentName' on each record, and that you know the path to the folder.

If [Abs(Get(CurrentPlatform))>1]

SetField[g_docFilePath;"file"&Middle(Get(CurrentFilePath);Position(Get(CurrentFilePath);":";1;1);

Position(Get(CurrentFilePath);"/";1;PatternCount(Get(CurrentFilePath);"/"))-Position(Get(CurrentFilePath);":";1;1)+1) & DocumentName & ".doc"]

OpenUrl [g_docFilePath-no dialog]

Else

SetField[g_docFilePath;"file://"&Middle(Get(CurrentFilePath);

Position(Get(CurrentFilePath);"/";

Position(Get(CurrentFilePath);":";1;1)+2+(Get(CurrentPlatform)=-1);1);

Position(Get(CurrentFilePath);"/";1;PatternCount(Get(CurrentFilePath);"/"))

-

Position(Get(CurrentFilePath);"/";

Position(Get(CurrentFilePath);":";1;1)+2+(Get(CurrentPlatform)=-1);1)+1) & DocumentName & ".doc"]

OpenUrl [g_docFilePath-no dialog]

End If

Hi Ugo,

that's complicated. and cross-platform. but here's AppleScript: ;-)

set mypath to (path to documents folder) as string

set mypath to mypath & "word docs:"

tell application "FileMaker Developer"

tell document 1

tell current record

set docname to cell 1

set fullpath to mypath & (docname as string)

tell application "Microsoft Word"

try

open alias fullpath

on error

display dialog "doc not found!"

end try

end tell

end tell

end tell

end tell

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.