PDA

View Full Version : Storing data for use within a procedure



Jfp87
12-15-2015, 07:32 AM
Guys,

General question regarding the storage of data which will be used regularly by a procedure;

Say the data is 100+ MS Word pages, all containing tables of data which relate to different things. Would it be better storing it in:



the template which will use the data
a seperate Word document
multiple word documents dependant on data


An additional Excel worksheet may also be used for certain data.

I am basically trying to get a general idea of the best way to store data for use within an application - if that exists.

Cheers,
Joe

SamT
12-15-2015, 12:30 PM
best way to store data for use [by MS Office Applications]
IMO, MS Access, followed by MS Excel, with *.csv files a distant third. Word not in the same class.

Jfp87
12-15-2015, 01:04 PM
Is it common to use MS Access for a database of common text / paragraphs?

SamT
12-15-2015, 04:21 PM
Best is Access or Excel
Say the data is 100+ [???], all containing tables of data



Access or Excel might not be best
common text / paragraphs



If you change your mind again and say that it is images you want to store, then I give up.

Paul_Hossler
12-20-2015, 06:21 AM
General question regarding the storage of data which will be used regularly by a procedure;

What is the data?

Numbers?

Blocks of text?

Tables an tables?

Jfp87
12-22-2015, 02:41 AM
It will mostly be blocks of text Paul. How would you do it?

gmaxey
12-22-2015, 02:17 PM
If you need to store blocks of text then simply store them as building blocks in the template with the running code or any loaded template. It really doesn't matter.

SamT
12-22-2015, 02:30 PM
@ Greg,

The OP says he has hundreds of Tables of blocks of text. Would that make a difference?

gmaxey
12-22-2015, 02:46 PM
SamT,

I created a new template containing a single table then ran this code:

Sub Test()
Dim oTbl As Table
Dim i As Long
Dim oRng As Word.Range
For i = 1 To 500
Set oRng = ActiveDocument.Tables(1).Range
ThisDocument.AttachedTemplate.BuildingBlockEntries.Add Name:="New BB Entry" & i, Type:=wdTypeAutoText, Category:="General", Range:=oRng
Next i
End Sub

The macro took about 45 seconds to run, and I was left with 500 building blocks (all the same of course) which I could select and insert into any document. A similar process could be used to create 500 unique building blocks and is should work equally as well.

I don't think "several hundred" is a critical factor. How the OP intends to use the data, e.g., insert it, read it, etc. is probably the significant factor.

SamT
12-22-2015, 08:50 PM
Thanks,

I do hope that Jfp87 comes back and sees that there are experts here who can help him/her.