From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create shortcut to word file

Is it possible to create a windows shortcut to a word document from my application?

 

I am creating a word document based on user input, and would also like to place a shortcut to that file elsewhere.

 

Thanks


0 Kudos
Message 1 of 14
(4,031 Views)

There is a solution suggested here, it requires downloading an exe though.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 14
(4,028 Views)

I got curious how to do it without an external exe.

 

Here you go... (see attached)

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 3 of 14
(4,016 Views)

Troy - I'd like to take a look at your solution ... would you mind posting a version for those of us still back in 8.5?

 

Thanks.

 

 

0 Kudos
Message 4 of 14
(3,982 Views)

Here ya go...

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 5 of 14
(3,969 Views)

Hello everybody.

 

I have tried this example using windows 7, it does not work. A message says access denied. But you use windows xp, the example works perfectly.

 

I have administrator privileges. both windows 7 and windows xp

 

Thanks

0 Kudos
Message 6 of 14
(3,813 Views)

The defaults set in the vi were designed to work in Windows XP.

The location and working directory need to be changed for it to work in Windows 7.

 

Here is one with the defaults set to work in Windows 7...

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 7 of 14
(3,800 Views)

Hello Troy.

 

Do you know the location and working directory to create shorcut for all users in windows 7?. There are users don't have admin priviliges.

 

Thanks a lot.

0 Kudos
Message 8 of 14
(3,780 Views)

When I run the Create Shortcut.vi, when the shortcut is created, and I look at the Properties of the shortcut, there are double quotes (" ") around the Target name.  This shortcut points to an executable I am running.  The double quotes around the Target causes problems when I try to try to run the executable by doule clicking the shortcut - an error comes up.  If I go into the properties of the shortcut and remove the double quotes around the Target, and save, then when I double click the shortcut to run my executable, it runs just fine.

 

Any idea how/why the double quotes ends up in the Target field, and how do I make it so they don't appear when I run this Create Shortcut.vi?

0 Kudos
Message 9 of 14
(3,137 Views)

The double quotes are automatically added by the ActiveX function when there is a space in the path.

If there is no space, there are no quotes.

 

Do you have a space in the filepath? Is the only space the one in the "C:\Program Files" part?

Try using %ProgramFiles% instead.

 

So           "C:\Program Files\MyApp\MyExe.exe"

becomes  %ProgramFiles%\MyApp\MyExe.exe

 

What I don't understand is why the quotes are creating an error. It always seems to work fine for me.

What is your full path? What error are you getting?

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 10 of 14
(3,125 Views)