a windows application first.
This will accelerate identifying the problem.
I look forward to hearing from you.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: "Jaime Rios" <
[email protected]>
References: <
[email protected]>
<
[email protected]>
<
[email protected]>
Subject: Re: COM AddIn for Word does not store the position properly
Date: Tue, 23 Sep 2003 11:33:41 -0400
Lines: 136
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#
[email protected]>
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: 160.79.12.170
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109595
X-Tomcat-NG: microsoft.public.dotnet.general
Figured this one out, the COM AddIn was disabled under the disabled items
button in the Help->About Word dialog box. But I am still having problems
setting the toolbar position. Here is the code, but it keeps giving me
the
error:
Error of type: 458 has occurred.
Desc: Bad variable type
When I try to set the position properties! Any ideas? Thanks in advance!
Dim lToolbarPos As Long
Dim lToolbarIndex As Long
Dim lToolbarTop As Long
Dim lToolbarLeft As Long
' Get the toolbar position
lToolbarPos = CLng(GetSetting("SampleToolbar", "General",
"ToolbarPos", CStr(msoBarTop)))
lToolbarIndex = CLng(GetSetting("SampleToolbar", "General",
"ToolbarIndex", 0))
lToolbarLeft = CLng(GetSetting("SampleToolbar", "General",
"ToolbarLeft", 100))
lToolbarTop = CLng(GetSetting("SampleToolbar", "General",
"ToolbarTop", 100))
With applicationObject.CommandBars("Sample Toolbar")
If lToolbarPos = msoBarTop Or lToolbarPos = msoBarBottom
Or
_
lToolbarPos = msoBarLeft Or lToolbarPos = msoBarRight
Then
' Set the leftmost position of the toolbar.
If lToolbarLeft < 0 Then
.Left = 100
Else
.Top = lToolbarTop
.Left = lToolbarLeft
End If
' Place the toolbar in the correct row.
If lToolbarIndex < 0 Then
.RowIndex = 1
Else
.RowIndex = lToolbarIndex
End If
End If
End With
Jaime Rios
Now I am having a problem where the COM AddIn will not load at all! Is
there
a setting or something that Word has done to prevent it from loading?
Jaime
Hi Jaime,
You may try to check if the Registry setting has been set. [using the
regedit tool]
The setting is usually under the Key
HKEY_CURRENT_USER\Software\VB and VBA Program Settings
and
HKEY_USERS\<S-1-5-21-2146773085-903363285-719344707-166692>\Software\VB
and
VBA Program Settings\AppTest
the <> section may be different from yours. You may search using the
find
function in the regedit.
I suggest that you break the with-endwith section into four code line
to
see which function cause the error.
Since it seems the error you got is related with the File System, do
you
have any file system operation?
I look forward to hearing from you.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no
rights.
--------------------
Content-Class: urn:content-classes:message
From: "Jaime Rios" <
[email protected]>
Sender: "Jaime Rios" <
[email protected]>
Subject: COM AddIn for Word does not store the position properly
Date: Mon, 22 Sep 2003 06:09:19 -0700
Lines: 26
Message-ID: <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOBCrvTw0D7D7R6RiqyWJZyUpmpvA==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109406
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.general
Hi,
I created a COM AddIn for Word that performs the functions
that it needs to, but I needed to add the ability for the
toolbar created by the COM AddIn to remember it's last
position and whether it was docked or not. I added the
following code to my "OnConnection" function but it fails
with an error, "Run-time exception thrown :
System.IO.IOException - Bad file name or number."
With applicationObject.CommandBars("SampleToolbar")
.Left = CLng(GetSetting
("SampleToolbar", "General", "ToolbarLeft", 0))
.Top = CLng(GetSetting
("SampleToolbar", "General", "ToolbarTop", 0))
.Position = CLng(GetSetting
("SampleToolbar", "General", "ToolbarPos", CStr
(msoBarTop)))
.Index = CLng(GetSetting
("SampleToolbar", "General", "ToolbarIndex", 0))
End With
Any help is appreciated! Thanks!
Jaime Rios