Weird trick with Word2003 addins

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Weird trick with Word2003 addins

Post by ChrisGreaves »

In MSWord2003, or perhaps other versions of MSWord:-

Create a new template and store it in a data folder as “PeculiarPowerpointPresentation.ppt”. Yes, that is a PowerPoint extension on a MSWord template.
In this new template create a public procedure:-

Code: Select all

Sub APeculiarMacro()
    MsgBox "Hello!" & vbCrLf & "I am not a PowerPoint presentation."
End Sub
Exit Word, saving all your work.
Reload Word.
Using Tools, Addins, browse to your “PeculiarPowerpointPresentation.ppt” and add it in to your stable.
You can now run the macro “APeculiarMacro”

This has to have some valid use; maybe hiding useful stuff in a file that the average person (a) can not open in PowerPoint and (b) would not think of loading in MSWord.

Cheers
Chris
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78402
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Weird trick with Word2003 addins

Post by HansV »

Will this weird trick make me lose belly fat?
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird trick with Word2003 addins

Post by ChrisGreaves »

HansV wrote:
14 Dec 2021, 13:03
Will this weird trick make me lose belly fat?
Absolutely!
Logically it must be so, because since I built this trick, I have gained belly fat.
Mr Puzey (Physics 1961-63) told us that the Universe is a closed system.
So ...

P.S. Did you try it? The .PPT I mean? If not, you are about to see lodged a complaint from one or more other Lounge Members, given your proximity to Belgian chocolates.
P.P.S. I have attached a copy.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78402
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Weird trick with Word2003 addins

Post by HansV »

I did try it. You can in fact use any extension - .xyz for example, or no extension at all.
The idea behind is that documents created by Word contain a "signature" in the first few bytes of the file. Word looks at the start of a file to see if it is a Word document or template, regardless of the extension. So whether your add-in is named WeirdTrick.dot or WeirdTrick.ppt or WeirdTrick.xyz, Word will still recognize it as a valid Word add-in.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird trick with Word2003 addins

Post by ChrisGreaves »

HansV wrote:
14 Dec 2021, 13:42
The idea behind is that documents created by Word contain a "signature" in the first few bytes of the file. Word looks at the start of a file to see if it is a Word document or template, regardless of the extension. So whether your add-in is named WeirdTrick.dot or WeirdTrick.ppt or WeirdTrick.xyz, Word will still recognize it as a valid Word add-in.
Gary C. Kessler’s Table of File Signatures is responsible for setting my devious mind :evilgrin: along this, to coin a phrase, path.

I noted that In that table “D0 CF 11 E0 A1 B1 1A E1” is suggested as an 8-byte signature for the leading bytes of an MSWord template (you can test this now), but a list of extents (DOC, DOT, PPS, PPT, XLA, XLS, WIZ) is associated with this byte string. Note too “used by Microsoft Office 97-2003 applications”, so that signature might confirm that you have a file whose contents were produced by an MSOffice97-2003 application, but will not in isolation identify the specific application.
In particular that byte signature may not apply to files produced by later versions of MSOffice (2007, 2010, Office 2019, 365 and so on)

I believe that this will be true for all files with signatures produced by all applications across all digital platforms.

Cheers
Chris
There's nothing heavier than an empty water bottle

User avatar
SpeakEasy
4StarLounger
Posts: 544
Joined: 27 Jun 2021, 10:46

Re: Weird trick with Word2003 addins

Post by SpeakEasy »

>“D0 CF 11 E0 A1 B1 1A E1” is suggested as an 8-byte signature for the leading bytes of an MSWord template

D0 CF 11 E0 A1 B1 1A E1 is the signature for any COM structured storage compound file, sometimes more simply known colloquially as a compound document (by the way, check out the first 4 bytes - D0CF11E(0)). And a fair number of applications beyond older versions of Office use it , - e.g. SQL Server 2000 DTS packages, and even some not from Microsoft such as Solidworks,

More recent versions of Office, now using Office Open XML as the default file format, will have a header of 50 4B 03 04 - which is the header for a ZIP file ...

User avatar
HansV
Administrator
Posts: 78402
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Weird trick with Word2003 addins

Post by HansV »

Thanks, both. I didn't know that.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird trick with Word2003 addins

Post by ChrisGreaves »

HansV wrote:
14 Dec 2021, 16:21
Thanks, both. I didn't know that.
Ah! But did you notice that the first seven bytes read "DocFile"?
:evilgrin: :evilgrin: :evilgrin: :evilgrin:
Cheers
Chris
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78402
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Weird trick with Word2003 addins

Post by HansV »

:hairout:
Best wishes,
Hans

User avatar
SpeakEasy
4StarLounger
Posts: 544
Joined: 27 Jun 2021, 10:46

Re: Weird trick with Word2003 addins

Post by SpeakEasy »

First 7 nibbles ...

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15587
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Weird trick with Word2003 addins

Post by ChrisGreaves »

SpeakEasy wrote:
14 Dec 2021, 18:22
First 7 nibbles ...
Ok SpeakEasy, I'll give you that one.

Cheers
Chris
There's nothing heavier than an empty water bottle