Macro to open html file using Microsoft Word

Macro to open html file using Microsoft Word

iamcdn79
Mentor Mentor
153 Views
0 Replies
Message 1 of 1

Macro to open html file using Microsoft Word

iamcdn79
Mentor
Mentor

I am in just the begining process of creating a macro that will write my selected nc program files to setup sheet files and then open in it in Microsoft Word.

 

But I am getting an error in Powermill when trying to open the file called "linuep sheet.html". Its saying "No program appears to be associated with the action 'open' on file 'C:/Powermill/1791/1791 cavity/SetupSheets_files/project_sheets/lineup
sheet.html' 

 

FUNCTION Main (STRING $Selected_NCProgram)

{
    // Execute preliminary commands
    KEEP SETUPSHEETS NCPROGRAM SELECTED
    TEXTINFO ACCEPT
    SPLITTER TABEXPLORE

    // Get the main project directory and construct the correct path
    STRING mainDirectory = dirname(project_pathname(0), "/")
    STRING projectSubfolder = project.Name + "" 
    STRING htmlFilePath = mainDirectory + "/" + projectSubfolder + "/SetupSheets_files/project_sheets/lineup sheet.html"
    
    // Attempt to open the specified .html file in the correct directory
    OLE FILEACTION 'open' $htmlFilePath
}

iamcdn79_1-1730812536904.png

 

 

Does anyone know the right command to open a HTML file with Word? I already have Word set to always open HTML files in windows setting

 

 


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes
154 Views
0 Replies
Replies (0)