strongm, I will give it a shot and report back
As a side note, I've just got the message that my original code started working all of the sudden. Everybody is surprised (me included) and they (users) give me a credit for fixing it (I will take it :) Who knows what had happened? Gremlins?
Edit -...
Nice progress, thank you combo
Your suggestion works - I had to replace some constants since I use Late Binding (wdReplaceAll = 2, wdFindContinue = 1) and I need to eliminate some extra code
Option Explicit
Sub outlookmail()
'Use the code from...
To show the 'Before' and 'After' shots maybe will explain better.
and after running some text replacement:
I may try to persuade them to use just simple text, but it would be nice to do it right.
A user has an Outlook Template (*.oft file) formatted as Rich Text where they have some text they would like to replace with the data from the data base (instead of typing or copy-n-paste). So I set the text in the Template that needs to be replaced matching the fields in the data base., i.e...
I have SQL Server Management Studio 20.1.10.0 and most of what I do I can manage (pun intended). When I run CREATE TABLE everything seams to be OK, and when I right-click on my new table and do “Select top 1000 Rows”, the basic Select SQL shows up and works just fine, but – all fields and the...
So it looks like your code and logic works, it just takes a LOT longer in production than it takes you in your 'sandbox' because of the number of files. Is that correct?
How about my original suggestion:
And I would move this one line for Caption outside the If-Then-Else:
If ctl.Name Like "cmdOrder*" Then
ctl.Visible = True
ctl.Caption = DLookup("[cmdCaption]", "tblCmds", "[cmdID]='" & ctl.Name & "'")
pic = DLookup("[PhotoURL]", "tblCmds", "[cmdID]='" & ctl.Name & "'")
If...
One way would be (and that would me my preferred way) to not allow NULL or empty PhotoURL field in tblCmds table.
Other way:
pic = DLookup("[PhotoURL]", "tblCmds", "[cmdID]='" & ctl.Name & "'")
If IsNull(pic) or pic & "" = "" Then
'Do something
Else
ctl.Picture = pic
End If
13 folders with 180,000 each, that would make your app run for about 6 hours
Aside from coding, could you paint a picture of what needs to be accomplished, what do anybody needs this functionality for? Hopefully these 13 folders are NOT filled with 1000's of files on regular basis.
Maybe...
With:
ctl.Picture = DLookup(...
what do you get from your DLookup? Is it just the name of the file, like MyPicture.bmp? Or full path with file name, like C:\SomeFolder\Images\MyPicture.bmp?
Thank you for the hints how to operate in TT now
Let me try to insert an image (with other 'problem') - my "Stay logged in" is always checked, even if I un-check it every time...
And even thou I have read all posts in the Forum, they still show up in BOLD and with NEW icon next to them.
Also, tried to add an Image to the post using the little icon Insert Image(Ctrl-P), but 2 steps after that the page stopped responding, no error, no message what I did wrong, any click...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.