473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create Shortycups in MS-Access ADP

I used to use this code to create shortcuts in my Access Jet MBD
programs but it won't work in Access ADP projects. I know it's related
to reference to CurrentDB.Properties (where it errors). IS there an
equivalent to do this in an ADP???
Any help is appreciated.
lq

Private Function CreateShortcut(myPath As String, myDest As Long,
dDrive As String)

Dim WScript As Object, myShortcut As Object, Sc As String
Set WScript = CreateObject("WScript.Shell")
Sc = GetSpecialFolderLocation(myDest)
Set myShortcut = WScript.CreateShortcut(Sc & "\NewsBase" & ".lnk")
myShortcut.TargetPath = myPath

On Error GoTo err_IconomyShortcut

myShortcut.IconLocation = CurrentDb.Properties("AppIcon")
myShortcut.WorkingDirectory = dDrive & ":\NewsBase"
myShortcut.Save

exit_CreateShortcut:
Set myShortcut = Nothing
Set WScript = Nothing
Exit Function
err_IconomyShortcut:
If Err.Number = 3270 Then
myShortcut.IconLocation = SysCmd(acSysCmdAccessDir) &
"\msaccess.exe, 1"
Resume Next
Else
MsgBox Err.Description
GoTo exit_CreateShortcut
End If
End Function
Nov 12 '05 #1
2 2551
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I used to use this code to create shortcuts in my Access Jet MBD
programs but it won't work in Access ADP projects. I know it's related
to reference to CurrentDB.Properties (where it errors). IS there an
equivalent to do this in an ADP???
Any help is appreciated.
lq

Private Function CreateShortcut(myPath As String, myDest As Long,
dDrive As String)

Dim WScript As Object, myShortcut As Object, Sc As String
Set WScript = CreateObject("WScript.Shell")
Sc = GetSpecialFolderLocation(myDest)
Set myShortcut = WScript.CreateShortcut(Sc & "\NewsBase" & ".lnk")
myShortcut.TargetPath = myPath

On Error GoTo err_IconomyShortcut

myShortcut.IconLocation = CurrentDb.Properties("AppIcon")
myShortcut.WorkingDirectory = dDrive & ":\NewsBase"
myShortcut.Save

exit_CreateShortcut:
Set myShortcut = Nothing
Set WScript = Nothing
Exit Function
err_IconomyShortcut:
If Err.Number = 3270 Then
myShortcut.IconLocation = SysCmd(acSysCmdAccessDir) &
"\msaccess.exe, 1"
Resume Next
Else
MsgBox Err.Description
GoTo exit_CreateShortcut
End If
End Function


Where do you now hope to store your IconLocation? In a SQL server table, or
in a location fixed relative to the adp? If so you could look at
CurrentProject.Path which gives the folder where the adp is. You can
navigate from there.

Fletcher


Nov 12 '05 #2
Fletcher,
I realized this after posting it that it simply refers to the location
of the icon file. I was thinking something else.
Regards,
lq

"Fletcher Arnold" <fl****@home.com> wrote in message news:<c1**********@hercules.btinternet.com>...
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I used to use this code to create shortcuts in my Access Jet MBD
programs but it won't work in Access ADP projects. I know it's related
to reference to CurrentDB.Properties (where it errors). IS there an
equivalent to do this in an ADP???
Any help is appreciated.
lq

Private Function CreateShortcut(myPath As String, myDest As Long,
dDrive As String)

Dim WScript As Object, myShortcut As Object, Sc As String
Set WScript = CreateObject("WScript.Shell")
Sc = GetSpecialFolderLocation(myDest)
Set myShortcut = WScript.CreateShortcut(Sc & "\NewsBase" & ".lnk")
myShortcut.TargetPath = myPath

On Error GoTo err_IconomyShortcut

myShortcut.IconLocation = CurrentDb.Properties("AppIcon")
myShortcut.WorkingDirectory = dDrive & ":\NewsBase"
myShortcut.Save

exit_CreateShortcut:
Set myShortcut = Nothing
Set WScript = Nothing
Exit Function
err_IconomyShortcut:
If Err.Number = 3270 Then
myShortcut.IconLocation = SysCmd(acSysCmdAccessDir) &
"\msaccess.exe, 1"
Resume Next
Else
MsgBox Err.Description
GoTo exit_CreateShortcut
End If
End Function


Where do you now hope to store your IconLocation? In a SQL server table, or
in a location fixed relative to the adp? If so you could look at
CurrentProject.Path which gives the folder where the adp is. You can
navigate from there.

Fletcher

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric Linders | last post by:
Hi, I have customer contact information in a MySQL DB. The standard stuff: first name, last name, city, state, zip, etc. I'd like to write a PHP script that will take a customer ID range...
13
by: Jeager | last post by:
Why is it, Microsoft manage to write operating systems and office applications with every bell and whistle facility known to man. Yet, even after years and years of development they still cannot...
2
by: Wongalogic | last post by:
Dear friends: Do you know how to change working time in MS Project by C#? I want to create a MS project file from C# using Project Library 9.0. I got MSProject.Application and MSProject.Project...
0
by: Jay Douglas | last post by:
Hello, I'm trying to create a Data Links Property window that behaves just like the dialog box in Visual Studio .Net for MS Sql Server connections. I've found a lot of examples that use...
0
by: Chad | last post by:
Hey everyone, I am trying to find an article I saw about 2 months ago (give or take a few days...) which showed how to create an MS-LIKE product key. This article did not use any components,...
1
by: prashantmalikiec | last post by:
Hi all, i am new to .net and my problem is that i am not able to create a ms word document using .net. i dont know how to write some text(hello world) into the word document thanks,...
1
by: ethersjunk | last post by:
I want to create a navigation tab that's similar to MS Outlook 2007's left navigation tab. A screen show of the UI can be found here: http://office.microsoft.com/en-us/outlook/HA101656351033.aspx ...
1
by: sangith | last post by:
Hi, I know I can create a MS word document using the module Win32::word::writer. But How do I write/insert text to the end of an existing MS word document. Is there any specific module for that? ...
1
by: massimiliano.capecchi | last post by:
Hello, I'm trying to import an excel spreadsheet and automatically create a table in MS SQL 2005 server. Do someone can help me? Thanks Vox69
0
by: WayneClements | last post by:
I have read various articles over and over again, including http://www.outlookcode.com/article.aspx?ID=25 and I cannot understand how to create a MS Outlook Contacts Provider in VB.NET I have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.