Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Trying to establish voice contact ... please ____yell into keyboard.


devel / comp.databases.ms-access / Re: Using VBA to edit hyperlinks

SubjectAuthor
* Using VBA to edit hyperlinksmusicloverlch
`* Using VBA to edit hyperlinksRon Weiner
 `* Using VBA to edit hyperlinksmusicloverlch
  +- Using VBA to edit hyperlinksRon Weiner
  `* Using VBA to edit hyperlinksRon Paii
   `* Using VBA to edit hyperlinksMichael Flynn
    `* Using VBA to edit hyperlinksmusicloverlch
     `* Using VBA to edit hyperlinksRon Weiner
      `- Using VBA to edit hyperlinksmusicloverlch

1
Using VBA to edit hyperlinks

<4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=870&group=comp.databases.ms-access#870

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a05:622a:1b01:b0:343:582f:3e07 with SMTP id bb1-20020a05622a1b0100b00343582f3e07mr15056521qtb.578.1661176179009;
Mon, 22 Aug 2022 06:49:39 -0700 (PDT)
X-Received: by 2002:a05:6870:d153:b0:11c:c1f4:c100 with SMTP id
f19-20020a056870d15300b0011cc1f4c100mr8147467oac.130.1661176178663; Mon, 22
Aug 2022 06:49:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Mon, 22 Aug 2022 06:49:38 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:2c7:8c00:17f0:5ce9:3426:9778:d31d;
posting-account=Lr72qQoAAADkUv-gyUq0hiLVTj6vT-m8
NNTP-Posting-Host: 2601:2c7:8c00:17f0:5ce9:3426:9778:d31d
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
Subject: Using VBA to edit hyperlinks
From: lhowey@gmail.com (musicloverlch)
Injection-Date: Mon, 22 Aug 2022 13:49:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1385
 by: musicloverlch - Mon, 22 Aug 2022 13:49 UTC

Hi there,

I have about 50,000 hyperlinks that I need to edit and a quick Google search didn't turn up anything on how to do it without editing each one individually.

I need to change http://localhyperlink/ to https://onlinehyperlink/

Any ideas that would get me moving in the right direction would be appreciated.

Thanks,
Laura

Re: Using VBA to edit hyperlinks

<te02np$2m88m$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=871&group=comp.databases.ms-access#871

  copy link   Newsgroups: comp.databases.ms-access
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rw@domain.com (Ron Weiner)
Newsgroups: comp.databases.ms-access
Subject: Re: Using VBA to edit hyperlinks
Date: Mon, 22 Aug 2022 10:09:48 -0400
Organization: WorksRite
Lines: 25
Message-ID: <te02np$2m88m$1@dont-email.me>
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Aug 2022 14:10:01 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9d840492e0939f7aae22857d8ad19053";
logging-data="2826518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+D1i5ijpElHEBZji1+Zl6d"
Cancel-Lock: sha1:NbkHC0z9ZVP+zBA83uCfbKr7hBg=
X-ICQ: 1701145376
X-Antivirus: AVG (VPS 220822-0, 8/21/2022), Outbound message
X-Newsreader: MesNews/1.08.06.00-gb
X-Antivirus-Status: Clean
 by: Ron Weiner - Mon, 22 Aug 2022 14:09 UTC

on 8/22/2022, musicloverlch supposed :
> Hi there,
>
> I have about 50,000 hyperlinks that I need to edit and a quick Google search
> didn't turn up anything on how to do it without editing each one
> individually.
>
> I need to change http://localhyperlink/ to https://onlinehyperlink/
>
> Any ideas that would get me moving in the right direction would be
> appreciated.
>
> Thanks,
> Laura

You don't say where all of these hyperlinks are located, but assuming
that you can access them one at a time, the VBA Replace command is your
friend.

replace("http://localhyperlink/","localhyperlink","onlinehyperlink")

If you don't have a way to get access to each hyperlink one a at a time
(in a loop perhaps), we'll need more information.

Rdub

Re: Using VBA to edit hyperlinks

<1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=872&group=comp.databases.ms-access#872

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a05:620a:1537:b0:6ba:be3d:d70f with SMTP id n23-20020a05620a153700b006babe3dd70fmr13074156qkk.578.1661183128443;
Mon, 22 Aug 2022 08:45:28 -0700 (PDT)
X-Received: by 2002:a05:6808:1647:b0:33a:f484:2ae2 with SMTP id
az7-20020a056808164700b0033af4842ae2mr11056580oib.60.1661183128088; Mon, 22
Aug 2022 08:45:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Mon, 22 Aug 2022 08:45:27 -0700 (PDT)
In-Reply-To: <te02np$2m88m$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:2c7:8c00:17f0:5ce9:3426:9778:d31d;
posting-account=Lr72qQoAAADkUv-gyUq0hiLVTj6vT-m8
NNTP-Posting-Host: 2601:2c7:8c00:17f0:5ce9:3426:9778:d31d
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com> <te02np$2m88m$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
Subject: Re: Using VBA to edit hyperlinks
From: lhowey@gmail.com (musicloverlch)
Injection-Date: Mon, 22 Aug 2022 15:45:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2121
 by: musicloverlch - Mon, 22 Aug 2022 15:45 UTC

Thank you! That put me in the right direction. I wrote a little VBA to cycle through the table and replace all the hyperlinks

Private Sub Command0_Click()
Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("SELECT HyperlinkField FROM Table1;")

Do Until rst.EOF
rst.Edit
rst.Fields(0) = Replace(rst.Fields(0), "#http://localhyperlink/", "#https://onlinehyperlink/", 1)
rst.Update
rst.MoveNext
Loop

Set rst = Nothing

End Sub

So now I have a new problem. I know the hyperlinks are correct because when I manually copy and paste one into the browser, it works fine. However, when I click on the link in the database I get an error that says "Cannot download the information you requested." This is apparently a know issue. Sigh. There's always one more hurdle.

Thanks for your help!

Re: Using VBA to edit hyperlinks

<te09i2$2muf9$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=873&group=comp.databases.ms-access#873

  copy link   Newsgroups: comp.databases.ms-access
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rw@domain.com (Ron Weiner)
Newsgroups: comp.databases.ms-access
Subject: Re: Using VBA to edit hyperlinks
Date: Mon, 22 Aug 2022 12:06:13 -0400
Organization: WorksRite
Lines: 40
Message-ID: <te09i2$2muf9$1@dont-email.me>
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com> <te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 22 Aug 2022 16:06:26 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="9d840492e0939f7aae22857d8ad19053";
logging-data="2849257"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wVPIZ61xylIVKORUCrpB8"
Cancel-Lock: sha1:5s7dxdiQESUiOYPjsuJkJVnfac0=
X-ICQ: 1701145376
X-Newsreader: MesNews/1.08.06.00-gb
X-Antivirus: AVG (VPS 220822-2, 8/22/2022), Outbound message
X-Antivirus-Status: Clean
 by: Ron Weiner - Mon, 22 Aug 2022 16:06 UTC

After serious thinking musicloverlch wrote :
> Thank you! That put me in the right direction. I wrote a little VBA to cycle
> through the table and replace all the hyperlinks
>
> Private Sub Command0_Click()
> Dim rst As DAO.Recordset
>
> Set rst = CurrentDb.OpenRecordset("SELECT HyperlinkField FROM Table1;")
>
> Do Until rst.EOF
> rst.Edit
> rst.Fields(0) = Replace(rst.Fields(0), "#http://localhyperlink/",
> "#https://onlinehyperlink/", 1) rst.Update
> rst.MoveNext
> Loop
>
> Set rst = Nothing
>
> End Sub
>
> So now I have a new problem. I know the hyperlinks are correct because when
> I manually copy and paste one into the browser, it works fine. However, when
> I click on the link in the database I get an error that says "Cannot download
> the information you requested." This is apparently a know issue. Sigh.
> There's always one more hurdle.
>
> Thanks for your help!

I stopped updating Access quite some time ago. I am using Version 2007
and still create new projects for myself. I have found this version is
quite sufficent for my use.

Anyway using version 2007 I created a table with one field (of a
Hyperlink type) and pasted in a couple links. Opening the table and
clicking a link starts a browser instance and loads the page as I would
expect. I am guessing you are using one of those new snazzy
fan-dangled versions that want to protect you from EVERYTHING. Sorry
it didn't work out.

Rdub

Re: Using VBA to edit hyperlinks

<4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=874&group=comp.databases.ms-access#874

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a05:6214:d66:b0:496:fc5d:e1f6 with SMTP id 6-20020a0562140d6600b00496fc5de1f6mr2607528qvs.63.1661258472655;
Tue, 23 Aug 2022 05:41:12 -0700 (PDT)
X-Received: by 2002:a05:6808:1a04:b0:343:25c7:2f2f with SMTP id
bk4-20020a0568081a0400b0034325c72f2fmr1163430oib.248.1661258472181; Tue, 23
Aug 2022 05:41:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Tue, 23 Aug 2022 05:41:11 -0700 (PDT)
In-Reply-To: <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=65.30.79.18; posting-account=RurhpQoAAACBjKrwaxvElRMdPO3AZiPP
NNTP-Posting-Host: 65.30.79.18
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
<te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com>
Subject: Re: Using VBA to edit hyperlinks
From: ron81pai@gmail.com (Ron Paii)
Injection-Date: Tue, 23 Aug 2022 12:41:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 150
 by: Ron Paii - Tue, 23 Aug 2022 12:41 UTC

On Monday, August 22, 2022 at 10:45:30 AM UTC-5, musicloverlch wrote:
> Thank you! That put me in the right direction. I wrote a little VBA to cycle through the table and replace all the hyperlinks
>
> Private Sub Command0_Click()
> Dim rst As DAO.Recordset
>
> Set rst = CurrentDb.OpenRecordset("SELECT HyperlinkField FROM Table1;")
>
> Do Until rst.EOF
> rst.Edit
> rst.Fields(0) = Replace(rst.Fields(0), "#http://localhyperlink/", "#https://onlinehyperlink/", 1)
> rst.Update
> rst.MoveNext
> Loop
>
> Set rst = Nothing
>
> End Sub
>
> So now I have a new problem. I know the hyperlinks are correct because when I manually copy and paste one into the browser, it works fine. However, when I click on the link in the database I get an error that says "Cannot download the information you requested." This is apparently a know issue. Sigh. There's always one more hurdle.
>
> Thanks for your help!

You can handle the hyperlink with a form event procedure.
Use a normal text control for the hyperlink column.
In control's double click try the following

application.FollowHyperlink nz(me.[ControlName]),,True,false

If you get warnings then replace with some code originally written by Dev Ashish.

Ex in event procedure
fHandleFile nz(me.[ControlName]), ApiWindowOpenStyleEnum.WIN_NORMAL

Add to new module

'************ Code Start Dev Ashish. **********
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
Private Declare Function apiShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long

'***App Window Constants***
Public Enum ApiWindowOpenStyleEnum
WIN_NORMAL = 1 'Open Normal
WIN_MAX = 3 'Open Maximized
WIN_MIN = 2 'Open Minimized
End Enum

'***Error Codes***
Private Const ERROR_SUCCESS As Long = 32&
Private Const ERROR_NO_ASSOC As Long = 31&
Private Const ERROR_OUT_OF_MEM As Long = 0&
Private Const ERROR_FILE_NOT_FOUND As Long = 2&
Private Const ERROR_PATH_NOT_FOUND As Long = 3&
Private Const ERROR_BAD_FORMAT As Long = 11&

'***************Usage Examples*********************** Dev Ashish.
'Open a folder: ?fHandleFile("C:\TEMP\",ApiWindowOpenStyleEnum.WIN_NORMAL)
'Call Email app: ?fHandleFile("mailto:dash10@hotmail.com",ApiWindowOpenStyleEnum.WIN_NORMAL)
'Open URL: ?fHandleFile("http://home.att.net/~dashish", ApiWindowOpenStyleEnum.WIN_NORMAL)
'Handle Unknown extensions (call Open With Dialog):
' ?fHandleFile("C:\TEMP\TestThis", ApiWindowOpenStyleEnum..Win_Normal)
'Start Access instance:
' ?fHandleFile("I:\mdbs\CodeNStuff.mdb", WApiWindowOpenStyleEnum.in_NORMAL)
'
' Returns -1 as a string on Sucess
' Returns Windows Error code and ", Error Text" if failed to open file or path
'
' Use instead of application.followhyperlink if getting security warning
'****************************************************
'
Public Function fHandleFile(stFile As String, lShowHow As ApiWindowOpenStyleEnum) As String
On Error GoTo errfHandleFile
Dim lRet As Long
Dim varTaskID As Variant
Dim stRet As String

'First try ShellExecute
lRet = apiShellExecute(hWndAccessApp, vbNullString, _
stFile, vbNullString, vbNullString, lShowHow)

If lRet > ERROR_SUCCESS Then
stRet = vbNullString
lRet = -1
Else
Select Case lRet
Case ERROR_NO_ASSOC:
' 'Try the OpenWith dialog
' varTaskID = Shell("rundll32.exe shell32.dll,OpenAs_RunDLL " & stFile, WIN_NORMAL)
' lRet = (varTaskID <> 0)
' Don't try OpenWith (may not work on W10), return error 8-24-21
stRet = "Error: No File Association. Couldn't Execute!"
Case ERROR_OUT_OF_MEM:
stRet = "Error: Out of Memory/Resources. Couldn't Execute!"
Case ERROR_FILE_NOT_FOUND:
stRet = "Error: File not found. Couldn't Execute!"
Case ERROR_PATH_NOT_FOUND:
stRet = "Error: Path not found. Couldn't Execute!"
Case ERROR_BAD_FORMAT:
stRet = "Error: Bad File Format. Couldn't Execute!"
Case Else:
' Add error text on else 8-24-21
stRet = "Error: Couldn't Execute!"
End Select
End If
fHandleFile = lRet & _
IIf(stRet = vbNullString, vbNullString, ", " & stRet)

donefHandleFile:
Exit Function

errfHandleFile:
debug.print err.Description
Resume donefHandleFile
End Function

PS:
You can use the replace function in a query, which will be quicker then a record set.

Re: Using VBA to edit hyperlinks

<2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=875&group=comp.databases.ms-access#875

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a0c:f147:0:b0:496:cc55:9dbe with SMTP id y7-20020a0cf147000000b00496cc559dbemr100214qvl.18.1661360366905;
Wed, 24 Aug 2022 09:59:26 -0700 (PDT)
X-Received: by 2002:a54:4891:0:b0:344:8bd6:58aa with SMTP id
r17-20020a544891000000b003448bd658aamr3595571oic.257.1661360366445; Wed, 24
Aug 2022 09:59:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Wed, 24 Aug 2022 09:59:26 -0700 (PDT)
In-Reply-To: <4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=129.210.115.100; posting-account=KIvACwkAAACqw8z2Rbtn9ImPywkjXOa4
NNTP-Posting-Host: 129.210.115.100
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
<te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
<4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com>
Subject: Re: Using VBA to edit hyperlinks
From: mflynn@scu.edu (Michael Flynn)
Injection-Date: Wed, 24 Aug 2022 16:59:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 7092
 by: Michael Flynn - Wed, 24 Aug 2022 16:59 UTC

On Tuesday, August 23, 2022 at 5:41:15 AM UTC-7, Ron Paii wrote:
> On Monday, August 22, 2022 at 10:45:30 AM UTC-5, musicloverlch wrote:
> > Thank you! That put me in the right direction. I wrote a little VBA to cycle through the table and replace all the hyperlinks
> >
> > Private Sub Command0_Click()
> > Dim rst As DAO.Recordset
> >
> > Set rst = CurrentDb.OpenRecordset("SELECT HyperlinkField FROM Table1;")
> >
> > Do Until rst.EOF
> > rst.Edit
> > rst.Fields(0) = Replace(rst.Fields(0), "#http://localhyperlink/", "#https://onlinehyperlink/", 1)
> > rst.Update
> > rst.MoveNext
> > Loop
> >
> > Set rst = Nothing
> >
> > End Sub
> >
> > So now I have a new problem. I know the hyperlinks are correct because when I manually copy and paste one into the browser, it works fine. However, when I click on the link in the database I get an error that says "Cannot download the information you requested." This is apparently a know issue. Sigh. There's always one more hurdle.
> >
> > Thanks for your help!
> You can handle the hyperlink with a form event procedure.
> Use a normal text control for the hyperlink column.
> In control's double click try the following
>
> application.FollowHyperlink nz(me.[ControlName]),,True,false
>
> If you get warnings then replace with some code originally written by Dev Ashish.
>
> Ex in event procedure
> fHandleFile nz(me.[ControlName]), ApiWindowOpenStyleEnum.WIN_NORMAL
>
> Add to new module
>
> '************ Code Start Dev Ashish. **********
> ' This code was originally written by Dev Ashish.
> ' It is not to be altered or distributed,
> ' except as part of an application.
> ' You are free to use it in any application,
> ' provided the copyright notice is left unchanged.
> '
> ' Code Courtesy of
> ' Dev Ashish
> Private Declare Function apiShellExecute Lib "shell32.dll" _
> Alias "ShellExecuteA" _
> (ByVal hwnd As Long, _
> ByVal lpOperation As String, _
> ByVal lpFile As String, _
> ByVal lpParameters As String, _
> ByVal lpDirectory As String, _
> ByVal nShowCmd As Long) _
> As Long
>
> '***App Window Constants***
> Public Enum ApiWindowOpenStyleEnum
> WIN_NORMAL = 1 'Open Normal
> WIN_MAX = 3 'Open Maximized
> WIN_MIN = 2 'Open Minimized
> End Enum
>
> '***Error Codes***
> Private Const ERROR_SUCCESS As Long = 32&
> Private Const ERROR_NO_ASSOC As Long = 31&
> Private Const ERROR_OUT_OF_MEM As Long = 0&
> Private Const ERROR_FILE_NOT_FOUND As Long = 2&
> Private Const ERROR_PATH_NOT_FOUND As Long = 3&
> Private Const ERROR_BAD_FORMAT As Long = 11&
>
> '***************Usage Examples*********************** Dev Ashish.
> 'Open a folder: ?fHandleFile("C:\TEMP\",ApiWindowOpenStyleEnum.WIN_NORMAL)
> 'Call Email app: ?fHandleFile("mailto:das...@hotmail.com",ApiWindowOpenStyleEnum.WIN_NORMAL)
> 'Open URL: ?fHandleFile("http://home.att.net/~dashish", ApiWindowOpenStyleEnum.WIN_NORMAL)
> 'Handle Unknown extensions (call Open With Dialog):
> ' ?fHandleFile("C:\TEMP\TestThis", ApiWindowOpenStyleEnum.Win_Normal)
> 'Start Access instance:
> ' ?fHandleFile("I:\mdbs\CodeNStuff.mdb", WApiWindowOpenStyleEnum.in_NORMAL)
> '
> ' Returns -1 as a string on Sucess
> ' Returns Windows Error code and ", Error Text" if failed to open file or path
> '
> ' Use instead of application.followhyperlink if getting security warning
> '****************************************************
> '
> Public Function fHandleFile(stFile As String, lShowHow As ApiWindowOpenStyleEnum) As String
> On Error GoTo errfHandleFile
> Dim lRet As Long
> Dim varTaskID As Variant
> Dim stRet As String
>
> 'First try ShellExecute
> lRet = apiShellExecute(hWndAccessApp, vbNullString, _
> stFile, vbNullString, vbNullString, lShowHow)
>
> If lRet > ERROR_SUCCESS Then
> stRet = vbNullString
> lRet = -1
> Else
> Select Case lRet
> Case ERROR_NO_ASSOC:
> ' 'Try the OpenWith dialog
> ' varTaskID = Shell("rundll32.exe shell32.dll,OpenAs_RunDLL " & stFile, WIN_NORMAL)
> ' lRet = (varTaskID <> 0)
> ' Don't try OpenWith (may not work on W10), return error 8-24-21
> stRet = "Error: No File Association. Couldn't Execute!"
> Case ERROR_OUT_OF_MEM:
> stRet = "Error: Out of Memory/Resources. Couldn't Execute!"
> Case ERROR_FILE_NOT_FOUND:
> stRet = "Error: File not found. Couldn't Execute!"
> Case ERROR_PATH_NOT_FOUND:
> stRet = "Error: Path not found. Couldn't Execute!"
> Case ERROR_BAD_FORMAT:
> stRet = "Error: Bad File Format. Couldn't Execute!"
> Case Else:
> ' Add error text on else 8-24-21
> stRet = "Error: Couldn't Execute!"
> End Select
> End If
> fHandleFile = lRet & _
> IIf(stRet = vbNullString, vbNullString, ", " & stRet)
>
> donefHandleFile:
> Exit Function
>
> errfHandleFile:
> debug.print err.Description
> Resume donefHandleFile
> End Function
>
> PS:
> You can use the replace function in a query, which will be quicker then a record set.

There's nothing wrong with the solutions proposed, but here's something else to think about.
When I'm faced with this kind of thing, I usually download the data in the table to a text file or a spreadsheet then use a bash script or a formula in Excel to edit the file or spreadsheet, then I reload it. This is usually pretty quick.

Re: Using VBA to edit hyperlinks

<08a6da72-b7f9-4691-9792-5b51c21008b9n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=876&group=comp.databases.ms-access#876

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a05:620a:2844:b0:6b8:5f52:a6b5 with SMTP id h4-20020a05620a284400b006b85f52a6b5mr216063qkp.351.1661362115147;
Wed, 24 Aug 2022 10:28:35 -0700 (PDT)
X-Received: by 2002:a05:6870:c18a:b0:101:fe5b:bd4e with SMTP id
h10-20020a056870c18a00b00101fe5bbd4emr44860oad.275.1661362114722; Wed, 24 Aug
2022 10:28:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Wed, 24 Aug 2022 10:28:34 -0700 (PDT)
In-Reply-To: <2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:2c7:8c00:17f0:25df:11ee:a457:fe8f;
posting-account=Lr72qQoAAADkUv-gyUq0hiLVTj6vT-m8
NNTP-Posting-Host: 2601:2c7:8c00:17f0:25df:11ee:a457:fe8f
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
<te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
<4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com> <2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <08a6da72-b7f9-4691-9792-5b51c21008b9n@googlegroups.com>
Subject: Re: Using VBA to edit hyperlinks
From: lhowey@gmail.com (musicloverlch)
Injection-Date: Wed, 24 Aug 2022 17:28:35 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1546
 by: musicloverlch - Wed, 24 Aug 2022 17:28 UTC

I have the Dev code in my system already but am encountering a known problem with Microsoft 365 and opening external links. Thanks everyone for your help!

Re: Using VBA to edit hyperlinks

<te5pri$3couj$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=877&group=comp.databases.ms-access#877

  copy link   Newsgroups: comp.databases.ms-access
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rw@domain.com (Ron Weiner)
Newsgroups: comp.databases.ms-access
Subject: Re: Using VBA to edit hyperlinks
Date: Wed, 24 Aug 2022 14:15:14 -0400
Organization: WorksRite
Lines: 9
Message-ID: <te5pri$3couj$1@dont-email.me>
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com> <te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com> <4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com> <2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com> <08a6da72-b7f9-4691-9792-5b51c21008b9n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 24 Aug 2022 18:15:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b3b3e239185dc78e12abc5b2e79e476b";
logging-data="3564499"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NkUXLJ7vJ5zCwx649nOKP"
Cancel-Lock: sha1:Sgl678kTdVrrzlHflt2f3DcULlU=
X-Newsreader: MesNews/1.08.06.00-gb
X-Antivirus-Status: Clean
X-Antivirus: AVG (VPS 220824-0, 8/23/2022), Outbound message
X-ICQ: 1701145376
 by: Ron Weiner - Wed, 24 Aug 2022 18:15 UTC

musicloverlch brought next idea :
> I have the Dev code in my system already but am encountering a known problem
> with Microsoft 365 and opening external links. Thanks everyone for your
> help!

Have you looked here?
https://support.microsoft.com/en-us/office/block-or-unblock-external-content-in-office-documents-10204ae0-0621-411f-b0d6-575b0847a795

Rdub

Re: Using VBA to edit hyperlinks

<dda821d0-94c3-4998-baca-189c1420d5a8n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=878&group=comp.databases.ms-access#878

  copy link   Newsgroups: comp.databases.ms-access
X-Received: by 2002:a05:620a:2947:b0:6bb:5ff8:bb77 with SMTP id n7-20020a05620a294700b006bb5ff8bb77mr579956qkp.537.1661369569248;
Wed, 24 Aug 2022 12:32:49 -0700 (PDT)
X-Received: by 2002:a4a:e0d8:0:b0:44a:e39b:26d4 with SMTP id
e24-20020a4ae0d8000000b0044ae39b26d4mr200096oot.2.1661369568930; Wed, 24 Aug
2022 12:32:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ms-access
Date: Wed, 24 Aug 2022 12:32:48 -0700 (PDT)
In-Reply-To: <te5pri$3couj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:2c7:8c00:17f0:25df:11ee:a457:fe8f;
posting-account=Lr72qQoAAADkUv-gyUq0hiLVTj6vT-m8
NNTP-Posting-Host: 2601:2c7:8c00:17f0:25df:11ee:a457:fe8f
References: <4ec8da09-f7ce-4a9d-b9ee-0b57a694576en@googlegroups.com>
<te02np$2m88m$1@dont-email.me> <1d2acd64-4aee-4030-98c3-dc6132e6cb63n@googlegroups.com>
<4192dbbe-bf12-4988-8832-7e3ee516f23bn@googlegroups.com> <2f0aa5fa-5636-4e49-8dab-910048abb2d9n@googlegroups.com>
<08a6da72-b7f9-4691-9792-5b51c21008b9n@googlegroups.com> <te5pri$3couj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dda821d0-94c3-4998-baca-189c1420d5a8n@googlegroups.com>
Subject: Re: Using VBA to edit hyperlinks
From: lhowey@gmail.com (musicloverlch)
Injection-Date: Wed, 24 Aug 2022 19:32:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1880
 by: musicloverlch - Wed, 24 Aug 2022 19:32 UTC

I've tried everything. I did discover that it wasn't all external links, just ones on SharePoint Online. We use SharePoint to store our documents and then I store the link to that document in Access with all the metadata about it. We currently use On Prem SharePoint and it works great, but I'm being pushed to move it to SharePoint Online and it just isn't working.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor