Custom Command to Externally Open Documents (PDF, Excel, Word, etc.)

Custom Command to Externally Open Documents (PDF, Excel, Word, etc.)

Joshua7812
Enthusiast Enthusiast
876 Views
3 Replies
Message 1 of 4

Custom Command to Externally Open Documents (PDF, Excel, Word, etc.)

Joshua7812
Enthusiast
Enthusiast

First off, I'm new to the AutoCAD/VBA/.NET side of the Community Forum, so I apologize if this isn't the place for this. I believe it's something VBA should be able to do, so I at least wanted to start here.

 

I'm trying to create a custom Ribbon tab for my firm. I'd like to link buttons to company standards, CAD manuals, templates for legal descriptions, affidavits, closure reports, etc. These documents come in various forms (PDF, Word, Excel, etc.). Is it possible, whether by way of commands already in AutoCAD or by way of custom commands with VBA, to have commands/buttons open these types of files outside (not within) AutoCAD?

Vote for My Ideas:
More Table Options & Control
Allow further customization to Dragged State in Label Styles

System Specs:
Civil 3D 2025
OS: Windows 11, 32GB RAM, 64-bit
Processor: Intel(R) Core(TM) i7-14700F 2.10 GHz
GPU: NVIDIA GeForce RTX 4070 SUPER 16GB
0 Likes
Accepted solutions (1)
877 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor
Accepted solution

If all you want to do is open another app, then you don't need to code it. Just use the SHELL command. Your button macro would look something like this.

 

^C^CShell "C:\\Program Files\\Microsoft Office\\Office16\\excel.exe"

 

You could also just send the file to shell and let Windows open the proper app from the file extension.

 

^C^CShell "C:\\User\\MyName\\Documents\\SomeSpreadsheet.xlxs"

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 4

Joshua7812
Enthusiast
Enthusiast

Thank you so much for the help! I didn't realize there was already such an easy method to do this.

Vote for My Ideas:
More Table Options & Control
Allow further customization to Dragged State in Label Styles

System Specs:
Civil 3D 2025
OS: Windows 11, 32GB RAM, 64-bit
Processor: Intel(R) Core(TM) i7-14700F 2.10 GHz
GPU: NVIDIA GeForce RTX 4070 SUPER 16GB
0 Likes
Message 4 of 4

Ed__Jobe
Mentor
Mentor

You might want to have a look at the acad.pgp file.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes