VBScript - Calling Word VB functions 
Author Message
 VBScript - Calling Word VB functions

Hi,

Is there a way of calling VB functions that are found within a Word / Office
document ("Macro"), assuming the file is found on the server side.

Example:
Let's say there is a Word document found on the server.
This document has one variable called UserName.
Whenever a user wants to download a file, prior of downloading it, I want to
set this variable to a new value (current user name).

Is it possible ?
Is it possible doing it without opening the file (Word document) ?
How do I refer to a specific document ?

Regards,
Ran Chen,



Sun, 13 Apr 2003 03:00:00 GMT  
 VBScript - Calling Word VB functions

Q160294 - ACC: Running a Microsoft Word 97 Macro Using Automation
http://support.microsoft.com/support/kb/articles/Q160/2/94.ASP

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Hi,

> Is there a way of calling VB functions that are found within a Word / Office
> document ("Macro"), assuming the file is found on the server side.

> Example:
> Let's say there is a Word document found on the server.
> This document has one variable called UserName.
> Whenever a user wants to download a file, prior of downloading it, I want to
> set this variable to a new value (current user name).

> Is it possible ?
> Is it possible doing it without opening the file (Word document) ?
> How do I refer to a specific document ?

> Regards,
> Ran Chen,




Sun, 13 Apr 2003 03:00:00 GMT  
 VBScript - Calling Word VB functions

Look at this...
run with excle, but it's the same with word

<html>
<body>
<form method=get>
<input type=text name =1>
<input type=text name =2>
 <input type=text name =3>
<input type=submit>
</form>
<%
un=request.querystring("1")
Deux=request.querystring("2")
trois=request.querystring("3")
if un <> "" then
'
****************************************************************************
****
' *
' * Excel Sample
' *

Dim objXL
Dim objXLchart
Dim intRotate

Set objXL = CreateObject("Excel.Application")
objXL.Workbooks.Add
objXL.Cells(1,1).Value = un
objXL.Cells(1,2).Value = deux
objXL.Cells(1,3).Value = trois
objXL.Range("A1:C1").Select

Set objXLchart = objXL.Charts.Add()
objXL.Visible = True
objXLchart.Type = -4100

 objXL.ActiveChart.SeriesCollection(1).Select
   '  objXL.Selection.Border.Weight  ="xlThin"
        'objXL.Selection.BOrder.LineStyle  "xlAutomatic"

   ' objXL.Selection.InvertIfNegative  "False"
   ' objXL.Selection.Fill.PresetTextured "presetTexture msoTexturePaperBag"
  '  objXL.Selection.Fill.Visible  "True"
'objXL.Selection.Fill "PresetTextured:=msoTexturePaperBag"
'For j=1 to 5
for i = 1 to 10
objXL.Selection.Interior.ColorIndex = i

For intRotate = 5 To 180 Step 5

    objXLchart.Rotation = intRotate

'        .Perspective = 70
 '       .Rotation = 155
  '      .RightAngleAxes = False
   '     .HeightPercent = 100
    '    .AutoScaling = True
Next
For intRotate = 5 To 180 Step 5
objXLchart.Elevation = intRotate -90
next
next
'next
' With Selection.Interior
 '       .ColorIndex = 46
  '      .Pattern = xlSolid
   ' End With

'For intRotate = 5 To 180 Step 5
'    objXLchart.Rotation = intRotate
'Next

'For intRotate = 175 To 0 Step -5
'    objXLchart.Rotation = intRotate
'Next
'FileN="C:\WINDOWS\Desktop\Classeur6.htm"
'objXL.ActiveWorkbook.SaveAs 'Filename:=FileN, FileFormat:=xlHtml,
ReadOnlyRecommended:=False, CreateBackup:=False
end if
%>



Quote:
> Hi,

> Is there a way of calling VB functions that are found within a Word /
Office
> document ("Macro"), assuming the file is found on the server side.

> Example:
> Let's say there is a Word document found on the server.
> This document has one variable called UserName.
> Whenever a user wants to download a file, prior of downloading it, I want
to
> set this variable to a new value (current user name).

> Is it possible ?
> Is it possible doing it without opening the file (Word document) ?
> How do I refer to a specific document ?

> Regards,
> Ran Chen,




Sun, 20 Apr 2003 03:58:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Calling Word function from VB Script

2. Calling a VBScript function from a host VB application

3. ?Calling VBScript function in VB code

4. call a VBscript function from VB

5. Calling VB function from jscript/vbscript?

6. Calling a VBScript function from a host VB application

7. Calling a function in Word

8. call function from vb

9. Call a JavaScript function from VB Script

10. calling java function through vb script

11. How can I call jscript function from vb?

12. call functions in VB

 

 
Powered by phpBB® Forum Software