Macro command to open html file using Microsoft Word

Macro command to open html file using Microsoft Word

iamcdn79
Mentor Mentor
2,924 Views
41 Replies
Message 1 of 42

Macro command to open html file using Microsoft Word

iamcdn79
Mentor
Mentor

I just posted this 2 mins ago and it got deleted by someone in the forum page, so sorry if its not as detailed cause I am furious right now about it getting deleted

 

I am trying to create a macro that opens HTML files using Microsoft Word but get an error saying no program appears to be associated... 

 

Does anyone know the right command to open HTML files?

 

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-1730813430496.png

 

 


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
Accepted solutions (2)
2,925 Views
41 Replies
Replies (41)
Message 41 of 42

artur.boszczyk
Advocate
Advocate

VBScript is getting deprecated

0 Likes
Message 42 of 42

iamcdn79
Mentor
Mentor

I know i just read that last night. By 2027 it will be finished 😠 will have to look into javascript now


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