Skip to content

Philip Wilmot

the ever learning IT professional

You have a Form which you have created, perhaps this Form is used for Ordering, you would then like to E-mail the order as a Report, outputted as PDF. You would also like the attachment (PDF Report) named based on your Order Number.

First create your report and customise it to your needs.

Back on your Form create a Command Button and use the Command Button Wizard to setup the basic Sending concept. Select Report Operations, then Mail Report. Select your report and enter your desired Text. Finally give it a meaningful name. This will create an [Event Procedure] for the On Click Property. It will look a little like the following:

Private Sub Command50_Click()
On Error GoTo Err_Command50_Click
Dim stDocName As String
stDocName = "rpt_stock_order_po"
DoCmd.SendObject acReport, stDocName
Exit_Command50_Click:
Exit Sub
Err_Command50_Click:
MsgBox Err.Description
Resume Exit_Command50_Click
End Sub

Modify the following line…

DoCmd.SendObject acReport, stDocName

…to look something more like

DoCmd.SendObject acReport, stDocName, acFormatPDF, "supplier@company.com", , , "Ink Order", "Please find enclosed our Ink Order", True

This will specifically output the Report as PDF (Office 2007 SP2 Required), automatically add the Email address, complete the Subject Line  and fill out the Body of the Email. Should you want it to automatically send it change the True to False.
However you will notice the attachment is named whatever the Report is called or what is completed in the Report Caption property. If you have entered anything in the Report Caption property remove it now as we will automatically create this next. It will automatically be changed accordingly to a specific detail on your Report, such as a order number.

Open your Report and select an [Event Procedure] for the Report Load function.
Add the following line:

Me.Caption = "Order " & [your-order-number-field]

You will notice your Report title will change based upon your order number when opening the report. You will also notice that when trying to send your Report from your Form it still names the attachement to whatever your Report is called and not what the Caption is!
This is because we need the Report to open up before so it can process the Caption change. If we go back to the send Report code and inbetween declaring stDocName and DoCmd.SendObject add the following to Open your report.

DoCmd.OpenReport stDocName, acPreview.

Upon clicking on your Command Button, the Report will open with the correct title caption, and your E-mail client will have the correctly named attachment based on it.

For example you want to allow your users to access www.bbc.co.uk but do not want them to access iPlayer. As iPlayer is a Subdirectory and not a subdomain we can not just add it to the domain block list or a custom category you may have set up. The best way is to create an Exception.

Log into your web filter.

1. Navigate to BLOCK/ACCEPT.

2. Select Exceptions.

3. Create a Block rule.  Under Category select URL Patterns. Under Sub Category/Expression enter www.bbc.co.uk/iplayer

4. Create a Allow rule. Under Category select Domains. Under Sub Category/Expression enter bbc.co.uk

Make sure the Block rule is above the Allow rule as Exceptions work from top down. In this case it will Block BBC iPlayer but then allow access to the BBC website.

You can find more information regarding Blocking Domain Subdirectories in the following Barracuda KB article here.

If you have set up a KMS Host / Client system (see here) but have not reached your 25 Client threshold yet and you are over your 30 days grace period, the chances are your Windows 7 Clients are notifying you that copy is not genuine. If you plan to reach this limit very soon (within 30 days) you can always reset your client machines by using slmgr /rearm. A restart will be required but you will be on a fresh 30 day grace period.
If you do not plan on reaching the threshold for awhile then you will probably want to convert your Clients to a MAK. This works very much like VLK however it does a one time activation with Microsoft for each machine you use it on. The limit of a MAK key depends on your license agreement, should you reach it you can contact Microsoft to see if you can extend it.
To request a MAK you can either log into your MVLS and request one through your account, or you can call Microsoft Product Activation (UK: 0800 0188354), provide your enrollment number and they will process a MAK and e-mail you with it.
Once you have your MAK key simply click on Change product key under Windows Activation. This will automatically change it from KMS to MAK and connect online and activate with Microsoft. Alternatively you can use slmgr /ipk <MAK>.

Tired of trying to find out what setting is located where? How about a place where all settings are grouped together? Enter Windows 7 God Mode.

Right click on your Desktop.

Create a New Folder

Rename it to GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

The icon will change from a standard folder to a configuration folder. Open it to access God Mode. You can copy this shortcut to a USB stick should you wish and take it to use on other Windows 7 PC’s.

You have deployed managed software via Group Policy. When you come to remove that software via Group Policy the client machine (Windows XP) will hang at “Removing managed software…”. This is most likely caused by a dialog prompt popping up during the uninstall and as you can not see this during the removal process the computer will just stay stuck at the removing software display.
If this is a per-computer package then the best way around it is to boot the affected computer up in Safe Mode, enter regedit and find navigate to the following:

HKLM\Software\Microsoft\Windows\CurrentVersion\Group Policy\Appmgmt

Then find the correct key, this is easy to do by looking at each key’s “Deployment Name“. Once you have found the correct key simply delete it and reboot. The computer will boot normally now and you can then remove the offending software via Control Panel.

Remember back in the Windows XP days? If you purchased the Upgrade version and wanted to do a clean install on a virgin hard drive, XP would ask you to put in the disk containing a previous version of Windows. How easy was that.

Vista was a lot more difficult to get around. You had to to a double install of Vista.

With Windows 7, it has all changed again. Luckily it can be very simple workaround – a simple registry tweak.

1. Disconnect from the internet, this just stops any automatic activation or updates coming through once Windows has installed, and although it does not matter, it’s just a extra step you got to wait until they are finished before doing the workaround.

2. Install Windows 7, when it asks you to input the product key, skip it.

3. Once Windows 7 has finished installing open regedit.exe.

4. Navigate to the following: HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Setup/OOBE/

5. Find MediaBootInstall, double click it and change the value from “1” to “0“. If for some strange reason it is already at 0 all is good, skip to step 7.

6. Enter cmd in Start Menu search to load Command Prompt, however right click on it and select Run As Administrator. Enter slmgr /rearm

7. After the “Command completed successfully” dialog restart your computer. Once back in Windows, right click on Computer, Properties and under Windows Activation enter your Product Key and Activate.

One good thing about Vista’s DVD is that any DVD version could install another. For example a Home Premium DVD could install the Ultimate Version. A retail DVD could install a OEM version. What defined what could be installed was the actual Product Key.
So as long as you had a Ultimate Product Key you could use a Home Premium DVD should you lose your Ultimate. You could also use a retail Vista DVD and your OEM Product Key to do a nice vanilla install on your brand new crapware filled laptop.

This all changed with Windows 7. It seemed each DVD was different. That what it seemed like. But that’s not the case. There is a file called ei.cfg that controls which version is installed. Simply by deleting or renaming the file will remove the restriction and once again you will be given a choice of which version to install.

The file can be located inside the /sources/ folder. If you are installing from a USB stick this is dead easy to do however if you are installing from a DVD then you will need to re-create the DVD. The following guide will help you accomplish this.

Understanding Microsoft’s Volume Activation 2.0 they brought in with Vista and Server 2008 (and now Windows 7 & Server 2008 R2) can be a bit hard to get your head around. Although I can kind of understand why Microsoft stopped VLK, mainly down to easy piracy, moving to something quite different can be frustrating if you don’t do your homework.

How KMS Works
A server acts as the KMS Host, Clients then contact the KMS server. Once the KMS threshold has been met, the KMS host will send a activation request to Microsoft. The KMS Host will then activate the Clients. The KMS threshold is 5 for Windows Server 2008/R2 and 25 for Windows 7. If there are not enough clients to meet the threshold for activation then they will report to the KMS Host every two hours until the threshold is met.

KMS Host Keys Matched to Products They Activate
There are several key types. The table below, taken from TechNet, explains which type of key should be used and what they will activate. For example if you only have Standard and Enterprise Server you will only need KMS B key.

Volume product group Windows products Key type Products activated by key type
Windows Vista Windows Vista Business
Windows Vista Enterprise
KMS Windows Vista Business
Windows Vista Enterprise
Windows 7 Windows 7 Professional
Windows 7 Enterprise
KMS Windows Vista Business
Windows Vista Enterprise
Windows 7 Professional
Windows 7 Enterprise
Windows Server 2008 R2
Server Group A:
Windows Web Server® 2008 R2
Windows Server 2008 R2 HPC Edition
Windows HPC Server 2008 R2
KMS_A Windows Server 2008 R2 Group A
Windows Server 2008 Group A
Windows Vista Volume Editions
Windows 7 Volume Editions
Windows Server 2008 R2
Server Group B
Windows Server 2008 R2 Standard
Windows Server 2008 R2 Enterprise
KMS_B Windows Server 2008 R2 Group A
Windows Server 2008 Group A
Windows Server 2008 R2 Group B
Windows Server 2008 Group B
Windows Vista Volume Editions
Windows 7 Volume Editions
Windows Server 2008 R2
Server Group C
Windows Server 2008 R2 Datacenter
Windows Server 2008 R2 for Itanium-Based Systems
KMS_C Windows Server 2008 R2 Group A
Windows Server 2008 Group A
Windows Server 2008 R2 Group B
Windows Server 2008 Group B
Windows Server 2008 R2 Group C
Windows Server 2008 Group C
Windows Vista Volume Editions
Windows 7 Volume Editions

slmgr
Microsoft tool for configuring and managing activations from Windows. A few useful commands working with KMS.

slmgr /dlv
This will give you information regarding your software licensing service. Use this to check the client count contacting the KMS Host.

slmgr /rearm
Rearms the activation using the existing product key.

slmgr /upk
This will uninstall the product key.

slmgr /ipk <Product Key>
This will allow you the enter or change the product key.

slmgr /ato
This is the command line to activate windows.

nslookup -type=srv _vlmcs._tcp
This will tell you which server is listed in DNS for Volume Licensing. Basically what server is your KMS Server.

Need Default KMS Client key?
Microsoft provide the default KMS clients keys on their TechNet help site. Vista & Server 2008 here or Windows 7 & Server 2008 R2 here.

Installing Windows Server & Windows 7 Using KMS

First Server installation of Windows Server 2008 or R2
If you have not used KMS before and you are installing your first Windows Server 2008 use a KMS product key from your licensing agreement. This will act now as your KMS Host server. This product key will activate with Microsoft.

Further Server Installations of  Windows Server 2008 or R2
When it give you the chance to enter a product key do not enter anything, it should by default use a built in KMS Client key. Should you enter the same key as your first server or any other KMS product key you will have two servers acting as KMS Host. This is OK only if you PLAN to have two KMS Host servers. If you entered a KMS product key and realised you shouldn’t have, then we need to replace this key with a default KMS Client key.

Open a elevated command prompt and use the following commands. A restart will most likely be required after uninstalling the existing product key. You can find the KMS Client product key here (Vista & Server 2008) or here (Win7 & Server 2008 R2) , scroll down till you find the KMS Client Setup Keys.

slmgr /upk
slmgr /ipk <Product Key>

Installations Of Windows 7
Use the same guidelines as Further Server Installations. A default KMS client key is built into the installation of Windows 7, you will notice when installing it will not ask for a product key.

Activating Windows 7 with Windows Server 2008 (not R2)
You will most likely encounter problems when trying to activate Windows 7 when you have a Windows Server 2008 acting as a KMS Host. The problem here is that the KMS Host only knows about Vista and Server 2008, not Windows 7 and Server 2008 R2. An update has been released that updates Windows Server 2008. Once the update has been installed on the KMS Host the server will need to be restarted. You will then need to update the KMS Host with a KMS Server 2008 R2 key, even though you are only running Server 2008. You can find the KMS Host key from your licensing agreement.

slmgr /ipk <Product Key>

Followed by a stop and start of a KMS Service

net stop slsvc

net start slsvc

You should then find your Windows 7 can contact the KMS Host. If the threshold is not met, it will report that it could not activate. This is perfectly normal and you should not worry.
However it is advisable that if your long term plan is to have a number of clients under the threshold then you should consider using MAK keys instead.
See here for when to use MAK and how to convert to it.

For more information regarding KMS and activation then the Volume Activation Technical Reference Guide is a good place to start. It can be found here.

If you purchased Windows 7 Digital Download from their educational offer via Digital River you will have a choice of two files to download. An ISO or an extractable EXE. The ISO you can burn straight to disk to install from, the EXE you can install from within your existing copy of windows, alternatively you can put these files on a USB stick and install Windows 7 from there. You can also use the ISO or even an existing Windows 7 DVD to install from USB.

Windows 7 USB/DVD Download Tool
If you have a ISO or DVD instead of following the instruction below, Microsoft have now released a open source tool which does the process for you. You can view the blog post here and download the tool here. However if you have the Digital Download or want to do it yourself then please read on.

Digital River Download Preperation
The extractable EXE consits of 3 files; Win7-P-Retail-en-us-x64.exe, setup1.box, setup2.box.
Running the EXE will expand the files to a folder called expandedSetup. Inside this folder is all the usual files you would see on a Windows 7 DVD.

1. Run Win7-P-Retail-en-us-x64.exe

2. This will expand the the files to a folder called expandedSetup. Make a note of this location. For this explanation I expanded to C:\expandedSetup

Prerequisites
USB Stick – Minimum 4GB.
USB boot feature in BIOS.
Preperation takes place in a Windows Environment.

Preparing The USB

1. Enter  cmd and press Ctrl + Shift + Enter to open Command Prompt with Administrative rights.

2. Enter DISKPART in Command Prompt. This will load DISKPART utility in Command Prompt.

3. Enter LIST DISK. Under Disk ### note the disk number of the USB Stick. If you have one hard drive with one partition then the hard drive will be Disk 0 and the USB stick should be Disk 1. Checking the size of the disk should give it a way! For the purpose of this explanation I will assume your USB stick is Disk 1.

4. Enter SELECECT DISK 1. Your USB stick is now the selected device.

5. Enter the following in order:

CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS QUICK
ASSIGN

6. You can now exit DISKPART by typing EXIT. You will be now back at the Command Prompt. Leave it open.

Making USB Bootable Windows 7 Installation

Digital Download: Make sure you know the location of the expandedSetup folder from your digital download. For the purpose of this explanation I will use C:\expandedSetup

1. Make sure you know the drive letter of your USB stick (and DVD drive if using a Windows 7 DVD). For the purpose of this explanation I will use drive letter E: as USB stick and D: as DVD Drive.

2a. For Digital Download in Command Prompt enter the following

c:
cd expandedsetup
cd boot

2b. For DVD in Command Prompt enter the following

d:
cd boot

3. Your Command Prompt should display c:\expandedSetup\boot OR d:\boot

5. Type BOOTSECT.EXE /NT60 E:

Where “E” is the letter of your USB stick.

This will update the NTFS file system bootcode and should display
Successfully update NTFS filesystem bootcode. Bootcode was successfully updated on all targeted volumes.

6. Close Command Prompt.

7a. For Digital Download copy the contents of the expandedSetup folder to the root of the USB stick.

7b. For DVD copy the contents of the DVD to the root of the USB stick.

8. You now have a bootable Windows 7 Installation on a USB stick. Configure the BIOS to boot from USB.

——————

Windows 7 USB Installation – The Microsoft Press Way

Microsoft says the USB device should use the FAT32 file system. Here are Microsoft steps taken from MCTS Exam 70-680 Configuring Windows 7 Self-Paced Training Kit.

1. Connect the USB storage device to a computer running Windows 7 or  Windows Vista.

2. Open an elevated command prompt and type diskpart.

3. At the DISKPART> Prompt, type list disk. Identify which disk connected to the computer represents the USB storage device.

4. At the DISKPART> prompt, type select disk X where X is the number of the disk that you have identified as the USB storage device.

5. At the DISKPART> prompt, type clean. When the disk is clean, type create partition primary.

6. At the DISKPART> prompt, type format fs=fat32 quick. When the format is completed type active and then exit.

7. After you have completed these steps, copy all the files located on the Windows 7 installation DVD to the USB storage device.

8. Configure the BIOS computer on which you want to install Windows 7 to boot from the USB storage device.

Copyright  © 2010 Microsoft Press