VBA to creating autotext entries or quickparts in different catego

I have a VBA application that basically allows people to easily create 
autotext entiries, move them between machines and use them making comments on 
assignments. Currently it operates in EXACTLY the same way in Word 2003 and 
2007 (using userforms) and I want to keep that as long as possible. You can 
see the application at 
   http://emarking-assistant.baker-evans.com and either the screen image or 
the video demos will give you an idea of what I am doing

Currently I store all the comments in a long list of autotext entries that 
is displayed in a field  with the value of the entry shown underneath (so you 
don't have to remember). This is OK but people are now wanting to have 
different categories of comments e.g. grammar, presentation, content, 
assignment 1. These would be stored in separate files and displayed on the 
userform using tabbed fields.

I'm currently using 
  normalTemplate.AutoTextEntries.Add Name:=rgName.text, Range:=rgEntry
when I read the text from the table to create the autotext entries.

My question is: how can I use the AutoTextEntries.Add method to create 
autotext entries that are in different categories so it works in 2003 and 
2007?

I've tried the good old record the macro in 2003 and see what is produced 
method it does not seem to have an argument for the category or style. Can 
Word 2003 create autotext entries in different categories?

In Word 2007 it seems that I need to use 
objTemplate.BuildingBlockEntries.Add(Name:="New Building Block Entry", 
Type:=wdTypeWatermarks, _
   Category:="General", Range:=Selection.Range)

Any assistance would be VERY gratefully received.

-- 
Peter Evans
email: emarking-assistant@baker-evans.com
web site: http://emarking-assistant.baker-evans.com




0
Utf
12/27/2009 12:21:01 PM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
1455 Views

Similar Articles

[PageSpeed] 14

One of the major differences between Word 2003 and Word 2007 is the way they 
handle autotext. Word 2003 files autotexts by the paragraph styles applied 
to the stored texts. Word 2007 uses building blocks which can categorize 
entries into various groups. As Word 2003 VBA doesn't understand building 
blocks there is no way to create a single macro that can be selectively used 
in both versions.

-- 
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Peter" <Peter@discussions.microsoft.com> wrote in message 
news:3D025231-6D79-4D40-890A-BCAA604B8042@microsoft.com...
>I have a VBA application that basically allows people to easily create
> autotext entiries, move them between machines and use them making comments 
> on
> assignments. Currently it operates in EXACTLY the same way in Word 2003 
> and
> 2007 (using userforms) and I want to keep that as long as possible. You 
> can
> see the application at
>   http://emarking-assistant.baker-evans.com and either the screen image or
> the video demos will give you an idea of what I am doing
>
> Currently I store all the comments in a long list of autotext entries that
> is displayed in a field  with the value of the entry shown underneath (so 
> you
> don't have to remember). This is OK but people are now wanting to have
> different categories of comments e.g. grammar, presentation, content,
> assignment 1. These would be stored in separate files and displayed on the
> userform using tabbed fields.
>
> I'm currently using
>  normalTemplate.AutoTextEntries.Add Name:=rgName.text, Range:=rgEntry
> when I read the text from the table to create the autotext entries.
>
> My question is: how can I use the AutoTextEntries.Add method to create
> autotext entries that are in different categories so it works in 2003 and
> 2007?
>
> I've tried the good old record the macro in 2003 and see what is produced
> method it does not seem to have an argument for the category or style. Can
> Word 2003 create autotext entries in different categories?
>
> In Word 2007 it seems that I need to use
> objTemplate.BuildingBlockEntries.Add(Name:="New Building Block Entry",
> Type:=wdTypeWatermarks, _
>   Category:="General", Range:=Selection.Range)
>
> Any assistance would be VERY gratefully received.
>
> -- 
> Peter Evans
> email: emarking-assistant@baker-evans.com
> web site: http://emarking-assistant.baker-evans.com
>
>
>
> 


0
Graham
12/28/2009 6:46:42 AM
Reply:

Similar Artilces:

cannot create profiles in win 7 mail 32 bit
I upgraded to WIndows 7 professional 64 bit and still cannot get my MS Office 2003 to work properly. All the programs except Outlook seems to work fine. I am totally unable to open outlook without mail profiles. I click on mail in control panel and I get low memoery or resources too low. That's impossible. I have 4GB RAM and 1GB VRAM. In addition, I noticed to night that while I created a profile for myself as Admin, I do ot have admin permissions EVEN IF I say 'run as admin" If I open my profile, it syas Admin under my name yet shows up as standard user. I...

Creating a table
There's probably an easier way to do it but... I have a series of numbers in column A (150 in all) and a series of letters in column B (22 in all). In total there are 4800 rows. What I am trying to do is create a table with the number down the left hand side and the letters across the top. In each cell within the table I need to count how many times the combination of number/letter appears. Eg: A B C 201 0 2 2 202 3 0 1 203 3 6 4 I tried combining the number/letter into a single text field using the CONCATENATE function then filtering ...

Creating a letter from template
Is it possible in CRM? So far the only way i figured out to use templated is in an email and /KB-article. (And order offcourse) The thing i'm looking for is when selecting a contact, somehow i can make a letter activity and call a template that puts name & adress data etc. After that i should be able to print the letter, to put it in an enveloppe and send it someplace... So far it seems to me this cannot be done, but then again, i'm certainly not a CRM expert... Is it possible? If so, can anyone provide me the actions to be taken step by step ? thanks Kas "_Kas_&...

Simple Question-How to create more than one transaction on the Acc
If there is a question already posted let me know. The question is: I created a bank account information on the Account list icon and want to have more than (one)transactions listed and see each payee displayed separately on each page so i could have all the months posted with due dates and total listed. Thank you. In microsoft.public.money, a.j. wrote: >If there is a question already posted let me know. The question is: I created >a bank account information on the Account list icon and want to have more >than (one)transactions listed and see each payee displayed separately ...

How to create an "and" rule in Query Based Distribution Groups
Hi, With Exchange 2003 Query Based Distribution groups, is it possible to create an "and" rule? ie, all users who are based in "London" "and" have the first name "John"? Thanks, Curtis. -- Please reply to news group only. Thank you. Sure. (&(attribute1=blah)(attribute2=blah)) http://msdn.microsoft.com/library/en-us/adsi/adsi/search_filter_syntax.asp?frame=true -- Bharat Suneja MCSE, MCT www.zenprise.com blog: www.suneja.com/blog ----------------------------------- "Curtis Fray" <xxx@xxx.com> wrote in message news:OjVc...

Creating a print-macro that'll only print page 1?
Hi, I have a spreadsheet that contains multiple sheets. I want to add a button that runs a macro, which only prints page 1 on the first sheet (called Scorekort). The "Scorekort" sheet contains 13 pages in total, but I only want to print the first page. Any ideas for this macro? Anders hi, Sub Macro1() Sheets("Scorekort").PrintOut From:=1, To:=1, Copies:=1, Preview:=True, Collate:=True End Sub if you don't want a print preview, Preview:=False -- isabelle Le 2011-05-21 04:16, Anders M a �crit : > Hi, > > I have a spreadsheet that contains multiple ...

Email accounts are not created for new user
I had a severe system crash several days ago because of bad memory in my domain controller (Server 2003 R2)/Exchange server 2003 (small site - no extra systems). I had to reinstall Exchange 2003 and reload the exchange store from backup. For existing users everything works great. Everybody can send and receive email, the calender works correctly, etc. OWA works. However, when I create a new user account in Active Directory Computers and Users, the account is created and the new user can log onto a system. However, Outlook 2003 cannot be configured to use the exchange server. In t...

Somehow I created a Macro in a worksheet.
I created a macro in an Excel worksheet somehow. I didn't try to, it just happened. Now everytime I open that workbook, it asks me if I want to run the macro, disable it, etc. How the hell do I get rid of the macro? It doesn't show up under tools, macros. And it apparently doesn't do anything either because I can disable it and nothing different happens. Who invented this system anyway? Thanks, V When you record a macro, a module is created to store the macro code. There are instructions here for removing the module that is causing the prompt to appear: http://www.c...

1 Chart
I presently have an XY line chart showing asset price over time. Pretty simple. X Axis - Time Scale Y Axis - Asset Price I would now like to add an additoinal series showing the volume of assets traded, ideally this would be as a bar chart sitting "underneath" the asset price on the chart. They would share the same X Axis. I have added another series, but this simply displays the volume traded as another line, and even when this is set to a secondary axis the scaling makes this unworkable. i have adjusted the scales of both, still this does not make it workable, i want the series...

we do not create seperate http virtual server anymore?
Hi all, Just want to confirm that we do not need to create the seperate http virtual server for FE/BE (backend two node A/P Exchange 2003 cluster), right? I remember I need to create it in Exchange 2000 FE/BE clustering envir. Thanks in advance. On Wed, 2 Aug 2006 11:44:26 -0700, John <John@discussions.microsoft.com> wrote: >Hi all, > >Just want to confirm that we do not need to create the seperate http virtual >server for FE/BE (backend two node A/P Exchange 2003 cluster), right? I >remember I need to create it in Exchange 2000 FE/BE clustering envir. > >...

Error creating new task
Error .. "Could not complete operation. One or more parameter values are not vaild" ...

Too many different cell formats #6
I am running into the error message: Too many different cell formats Is there a solution to lowering the number of formats I am using? Just trying to change them to make some consistent gives me the same error message. I tried running the search on the forums on my topic but they have been disabled for a Microsoft upgrade. Thanks! One idea - Rob Bovey's excellent Utilities add-in will list all the formats in use in your workbook, allowing you to manually delete what isn't being used. http://www.appspro.com/Utilities/ExcelUtilities.htm You can also see the source code for ...

create main configuration file for solution.
Hello. How can I create main configuration file for my solution (Win-Form : VS 2008. VB.NET), like a general ini-file. Thanks :) "Mr. X." wrote: > Hello. > How can I create main configuration file for my solution (Win-Form : VS > 2008. VB.NET), like a general ini-file. > It's called an app.config. There is a name space you can use to mainulupate the app.config from a program. I see it on the project source directory (not for solution). I cannot see it on the release directory. Is there any convention to read / write from app.config...

Creating Contacts For Accounts Using...
Hopefully as Microsoft CRM matures, many small time saving features will be added. One that should be a priority is the ability to add a new contact for an existing account using the common account information, i.e. address, phone number, web address, etc. Retyping the same company address in each time is not very productive. Thank you, Ed Podowski ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, f...

WdfUsbTargetDeviceCreate creates NULL Control Pipe Handle
Hi, We have a usb composite device which has one mass storage interface and another as a network interface. We are developing a WDF driver (NDIS-USB) for the network interface. Immediately after WdfUsbTargetDeviceCreate if I break into the debugger and examine the newly created device, then I see that the Control Pipe Handle is NULL! Here is the actual output: -------- kd> !WDFUSBDEVICE 0x0000057f`fe5905f8 WDFUSBDEVICE 0000057ffe5905f8 ============================= Config descriptor fffffa80037216b0, device descriptor fffffa8001a6fb58 Control USBD_PIPE_HANDLE 000000000000...

Create individual files from a row
I have an excel file with several thousand entries, which contain data in several columns. I would like to be able to create an individual xml or html file for each row, but with predifined formatting around so Mr A bloggs, A street, A town, AA1 1AA Could become Abloggs.html <head></head> <name>Mr A bloggs</name> <street>A street</street> Any other info here as well </html> etc. Is this possible and any suggestions how? thanks, Graham. -- GrahamN ------------------------------------------------------------------------ GrahamN's Profile: ...

Cannot create mailbox for new user accounts
I am running Exchange 2003 on Server 2003. I was able to move all existing mailboxes from my old Exchange 2000 server to my new 2003 server. Whenever I try to create a new user it creates the user normally and asks if I want to create a mailbox for the user. I check yes, and it says account created successfully. However, the mailbox never appears in Exchange, no email address is assigned to the new user, and I cannot send mail to the user account either. If I try to access any Exchange properties from ADUC it shows everyhting as if a mailbox exists, but there is no mailbox. I am ...

Scroll horizontaly with mouse, create same system used to scroll .
Hi, I think it would be great if mouses adopted a second scroll button, for horizontal scrolling, just like the vertical one .... Indeed, when you work with wide Excel spreadsheets, you can easily scroll down but to scroll from left to right or vice-versa, you have to use the scroll bar or arrows and it's annoying... So, am I a millionnaire yet??? Hi Frederic, > I think it would be great if mouses adopted a second scroll button, for > horizontal scrolling, just like the vertical one .... Indeed, when you work > with wide Excel spreadsheets, you can easily scroll down b...

Percentage difference calc that knows the largest figure
I have a calculation in cell A3 which looks at the content of Cell A1 and Cell A2 and then works out the difference between both as a percentage For instance Cell A1 = 100 Cell A2 = 10 Cell A3 returns the difference as being 90% My simple calculation in Cell A3 is as follows =(A1-A2)/A1 Cell A3 is formatted to give the answer as a percentage to 2 decimal places The above works fine as long as the number in Cell A1 is greater than the number in Cell A2 If the number in A2 is greater than the number in A1 then my calculated answer is incorrect For instance Cell A1 = 10...

One Entry to Multiple Rows
I have data that looks like this: X1 | Y1 Y2 Y3 Y4 X2 | Y4 Y5 Y6 Y7 And I need to get to: X1 | Y1 X1 | Y2 X1 | Y3 X1 | Y4 X2 | Y4 ...... etc. I can change the 2nd row's entries to more columns, but that doesn't seem to get me much closer to the needed format (and there are thousands of lines so I'd rather not do it manually). Any ideas? should do it. change mc to suit '===== Option Explicit Sub lineemup() Dim mc As Long Dim mr As Long Dim i As Long Dim lc As Long mc = 3 'col c mr = 1 For i = 1 To Cells(Rows.Count, mc).End(xlUp).Row lc ...

email address on Service Call Entry window
Add an email address field to the Service Call Entry window for the customer contact on the service call. Even if it is not pulled from the email address of the address id on the service call, at least the dispatcher could enter an email address on the service call in order to communicate with the customer regarding the call. It is common to take email address as part of contact information. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the m...

How do I create custom postcards in Word 2007?
I want to create my own postcards using the right size and type of paper for mailing. This depends entirely on your printer. Can it handle the heavy weight of card used in postcards, and can it handle the unusual size of a postcard? On Apr 18, 2:54=A0pm, Create Custom Postcards <Create Custom Postca...@discussions.microsoft.com> wrote: > I want to create my own postcards using the right size and type of paper = for > mailing. Perhaps the easiest way to start is to get some Avery (or similar) postcard stock, which will have two postcards per sheet. Then find the a...

How to write a new entry in a combo box to its underlying table
Dear Access 2007 VBA Gurus, I have a assets database (rather uncreatively named "Assets"). I use a form (named "Asset Acquisition Input Form New") to enter new assets. The "Manufacturer" field (combo box name "Manufacturers_ID) on this form is a lookup to a Manufacturers table. What I want to happen is when I enter an item that is not in the lookup list, I want a message box to prompt me to add the new entry to the underlying table, or to cancel and select an item from the list. I have no trouble with the MsgBox command itself. What I don&...

Publisher created webpage
I have created a web page in publisher, and am having a problem uploading it to a hosting site(angelfire). Any tips??? Thanks In the future utilize the webdesign forum at microsoft.public.publisher.webdesign You don't specify your version nor state what the problem is. I'd have to recommend you start by going over my tutorial at www.davidbartosik.com/ppt.htm on uploading to identify if you are following the correct procedures. If afterwards you are having a specific difficulty post as such in the web forum for follow-up. -- David Bartosik - MS MVP for Publisher help: www.davidbar...

Trying to Create a pop-up form
Due to size limitations on my main form, I am trying to create a form that, when I select a button, it pops up like a dialog box with the main form, Frm_Escheat, in the background I've created a qry which is the record source on my pop-up form. In the criteria of the query is: [Forms]![Frm_Escheat]![statecode] where [statecode] is the field from the Master Form. So, my "pop-up" form is activated when I select the button, but my problem is that it just goes to the pop-up form without the main form showing in the background. Thanks for your help. It would probably hel...